Skip to content

Commit ddd07bb

Browse files
committed
*use assert for nullifier salt length check
1 parent 7d1a5e3 commit ddd07bb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wormhole/circuit/src/nullifier.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ pub const SALT_BYTES_LEN: usize = 8;
2828
pub const NULLIFIER_SALT: &str = "~nullif~";
2929

3030
// Compile-time check: require NULLIFIER_SALT to have exactly SALT_BYTES_LEN bytes
31-
const _: [(); SALT_BYTES_LEN] = [(); NULLIFIER_SALT.len()];
31+
const _: () = {
32+
assert!(
33+
NULLIFIER_SALT.len() == SALT_BYTES_LEN,
34+
"invalid NULLIFIER_SALT length"
35+
);
36+
};
3237
pub const SECRET_BYTES_LEN: usize = 32;
3338
pub const SECRET_NUM_TARGETS: usize = DIGEST_NUM_FIELD_ELEMENTS;
3439
pub const SALT_NUM_TARGETS: usize = 3;

0 commit comments

Comments
 (0)