Skip to content

Commit ede76dc

Browse files
committed
chore: bump sha256
1 parent 69bcb34 commit ede76dc

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

Nargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ keywords = ["Noir", "nodash", "util", "hash"]
88

99

1010
[dependencies]
11-
sha256 = { tag = "v0.2.1", git = "https://github.com/noir-lang/sha256" }
11+
sha256 = { tag = "v0.3.0", git = "https://github.com/noir-lang/sha256" }
1212
keccak256 = { tag = "v0.1.1", git = "https://github.com/noir-lang/keccak256" }
1313
poseidon = { tag = "v0.1.1", git = "https://github.com/noir-lang/poseidon" }

src/hash.nr

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn pedersen<let N: u32>(input: [Field; N]) -> Field {
1010

1111
pub fn sha256<let N: u32>(input: impl ArrayOrBoundedVec<u8, N>) -> [u8; 32] {
1212
let input = input.as_bounded_vec();
13-
dep::sha256::sha256_var(input.storage(), input.len() as u64)
13+
dep::sha256::sha256_var(input.storage(), input.len())
1414
}
1515

1616
pub fn partial_sha256_interstitial<let N: u32>(
@@ -99,10 +99,7 @@ mod tests {
9999
),
100100
);
101101
assert(pedersen(FIELD_INPUT_ARR) == std::hash::pedersen_hash(FIELD_INPUT_ARR));
102-
assert(
103-
sha256(U8_INPUT_ARR)
104-
== dep::sha256::sha256_var(U8_INPUT_ARR, U8_INPUT_ARR.len() as u64),
105-
);
102+
assert(sha256(U8_INPUT_ARR) == dep::sha256::sha256_var(U8_INPUT_ARR, U8_INPUT_ARR.len()));
106103
assert(
107104
keccak256(U8_INPUT_ARR) == dep::keccak256::keccak256(U8_INPUT_ARR, U8_INPUT_ARR.len()),
108105
);

0 commit comments

Comments
 (0)