diff --git a/noir-projects/noir-contracts/contracts/avm_gadgets_test_contract/Nargo.toml b/noir-projects/noir-contracts/contracts/avm_gadgets_test_contract/Nargo.toml index c489feb117c..8b6344b9cd0 100644 --- a/noir-projects/noir-contracts/contracts/avm_gadgets_test_contract/Nargo.toml +++ b/noir-projects/noir-contracts/contracts/avm_gadgets_test_contract/Nargo.toml @@ -6,4 +6,5 @@ type = "contract" [dependencies] aztec = { path = "../../../aztec-nr/aztec" } +keccak256 = { tag = "v0.1.0", git = "https://github.com/noir-lang/keccak256" } sha256 = { tag = "v0.1.2", git = "https://github.com/noir-lang/sha256" } diff --git a/noir-projects/noir-contracts/contracts/avm_gadgets_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/avm_gadgets_test_contract/src/main.nr index 9755ffe4264..ae026813bf9 100644 --- a/noir-projects/noir-contracts/contracts/avm_gadgets_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/avm_gadgets_test_contract/src/main.nr @@ -6,7 +6,7 @@ contract AvmGadgetsTest { #[public] fn keccak_hash(data: [u8; 10]) -> [u8; 32] { - std::hash::keccak256(data, data.len() as u32) + keccak256::keccak256(data, data.len()) } #[public] diff --git a/noir-projects/noir-contracts/contracts/avm_test_contract/Nargo.toml b/noir-projects/noir-contracts/contracts/avm_test_contract/Nargo.toml index 1ba7f5b1cf2..7781f4552e6 100644 --- a/noir-projects/noir-contracts/contracts/avm_test_contract/Nargo.toml +++ b/noir-projects/noir-contracts/contracts/avm_test_contract/Nargo.toml @@ -8,3 +8,4 @@ type = "contract" aztec = { path = "../../../aztec-nr/aztec" } compressed_string = { path = "../../../aztec-nr/compressed-string" } sha256 = { tag = "v0.1.2", git = "https://github.com/noir-lang/sha256" } +keccak256 = { tag = "v0.1.0", git = "https://github.com/noir-lang/keccak256" } diff --git a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr index 53702d8c195..c33275171cc 100644 --- a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr @@ -627,7 +627,7 @@ pub contract AvmTest { dep::aztec::oracle::debug_log::debug_log("read_storage_map"); let _ = read_storage_map(context.this_address()); dep::aztec::oracle::debug_log::debug_log("keccak_hash"); - let _ = std::hash::keccak256(args_u8, args_u8.len()); + let _ = keccak256::keccak256(args_u8, args_u8.len()); dep::aztec::oracle::debug_log::debug_log("sha256_hash"); let _ = sha256::sha256_var(args_u8, args_u8.len() as u64); dep::aztec::oracle::debug_log::debug_log("poseidon2_hash"); diff --git a/noir-projects/noir-contracts/contracts/fee_juice_contract/Nargo.toml b/noir-projects/noir-contracts/contracts/fee_juice_contract/Nargo.toml index bab26316c4e..a223f60de93 100644 --- a/noir-projects/noir-contracts/contracts/fee_juice_contract/Nargo.toml +++ b/noir-projects/noir-contracts/contracts/fee_juice_contract/Nargo.toml @@ -9,3 +9,4 @@ aztec = { path = "../../../aztec-nr/aztec" } authwit = { path = "../../../aztec-nr/authwit" } deployer = { path = "../contract_instance_deployer_contract" } registerer = { path = "../contract_class_registerer_contract" } +keccak256 = { tag = "v0.1.0", git = "https://github.com/noir-lang/keccak256" } diff --git a/noir-projects/noir-contracts/contracts/fee_juice_contract/src/lib.nr b/noir-projects/noir-contracts/contracts/fee_juice_contract/src/lib.nr index 2fa51c33c05..390dc878c25 100644 --- a/noir-projects/noir-contracts/contracts/fee_juice_contract/src/lib.nr +++ b/noir-projects/noir-contracts/contracts/fee_juice_contract/src/lib.nr @@ -13,7 +13,7 @@ pub fn get_bridge_gas_msg_hash(owner: AztecAddress, amount: U128) -> Field { // The purpose of including the following selector is to make the message unique to that specific call. Note that // it has nothing to do with calling the function. - let selector = comptime { std::hash::keccak256("claim(bytes32,uint256)".as_bytes(), 22) }; + let selector = comptime { keccak256::keccak256("claim(bytes32,uint256)".as_bytes(), 22) }; for i in 0..4 { hash_bytes[i] = selector[i]; diff --git a/noir-projects/noir-contracts/contracts/token_portal_content_hash_lib/Nargo.toml b/noir-projects/noir-contracts/contracts/token_portal_content_hash_lib/Nargo.toml index 6c712909112..08e24bd5d44 100644 --- a/noir-projects/noir-contracts/contracts/token_portal_content_hash_lib/Nargo.toml +++ b/noir-projects/noir-contracts/contracts/token_portal_content_hash_lib/Nargo.toml @@ -6,3 +6,4 @@ type = "lib" [dependencies] aztec = { path = "../../../aztec-nr/aztec" } +keccak256 = { tag = "v0.1.0", git = "https://github.com/noir-lang/keccak256" } diff --git a/noir-projects/noir-contracts/contracts/token_portal_content_hash_lib/src/lib.nr b/noir-projects/noir-contracts/contracts/token_portal_content_hash_lib/src/lib.nr index 00e96726fc8..32039dfb512 100644 --- a/noir-projects/noir-contracts/contracts/token_portal_content_hash_lib/src/lib.nr +++ b/noir-projects/noir-contracts/contracts/token_portal_content_hash_lib/src/lib.nr @@ -11,7 +11,7 @@ pub fn get_mint_to_public_content_hash(owner: AztecAddress, amount: U128) -> Fie // The purpose of including the following selector is to make the message unique to that specific call. Note that // it has nothing to do with calling the function. - let selector = comptime { std::hash::keccak256("mint_to_public(bytes32,uint256)".as_bytes(), 31) }; + let selector = comptime { keccak256::keccak256("mint_to_public(bytes32,uint256)".as_bytes(), 31) }; for i in 0..4 { hash_bytes[i] = selector[i]; @@ -36,7 +36,7 @@ pub fn get_mint_to_private_content_hash(amount: U128) -> Field { // The purpose of including the following selector is to make the message unique to that specific call. Note that // it has nothing to do with calling the function. - let selector = comptime { std::hash::keccak256("mint_to_private(uint256)".as_bytes(), 24) }; + let selector = comptime { keccak256::keccak256("mint_to_private(uint256)".as_bytes(), 24) }; for i in 0..4 { hash_bytes[i] = selector[i]; @@ -65,7 +65,7 @@ pub fn get_withdraw_content_hash(recipient: EthAddress, amount: U128, caller_on_ // The purpose of including the following selector is to make the message unique to that specific call. Note that // it has nothing to do with calling the function. - let selector = comptime { std::hash::keccak256("withdraw(address,uint256,address)".as_bytes(), 33) }; + let selector = comptime { keccak256::keccak256("withdraw(address,uint256,address)".as_bytes(), 33) }; for i in 0..4 { hash_bytes[i] = selector[i]; diff --git a/noir-projects/noir-contracts/contracts/uniswap_contract/Nargo.toml b/noir-projects/noir-contracts/contracts/uniswap_contract/Nargo.toml index dbc2b0cf06d..a93d061c135 100644 --- a/noir-projects/noir-contracts/contracts/uniswap_contract/Nargo.toml +++ b/noir-projects/noir-contracts/contracts/uniswap_contract/Nargo.toml @@ -8,4 +8,5 @@ type = "contract" aztec = { path = "../../../aztec-nr/aztec" } authwit = { path = "../../../aztec-nr/authwit" } token = { path = "../token_contract" } -token_bridge = { path = "../token_bridge_contract" } \ No newline at end of file +token_bridge = { path = "../token_bridge_contract" } +keccak256 = { tag = "v0.1.0", git = "https://github.com/noir-lang/keccak256" } diff --git a/noir-projects/noir-contracts/contracts/uniswap_contract/src/util.nr b/noir-projects/noir-contracts/contracts/uniswap_contract/src/util.nr index 4e0421d6cbe..b1d5a4d30fa 100644 --- a/noir-projects/noir-contracts/contracts/uniswap_contract/src/util.nr +++ b/noir-projects/noir-contracts/contracts/uniswap_contract/src/util.nr @@ -30,7 +30,7 @@ pub fn compute_swap_public_content_hash( // The purpose of including the following selector is to make the message unique to that specific call. Note that // it has nothing to do with calling the function. let selector = comptime { - std::hash::keccak256( + keccak256::keccak256( "swap_public(address,uint256,uint24,address,uint256,bytes32,bytes32,address)".as_bytes(), 75, ) @@ -84,7 +84,7 @@ pub fn compute_swap_private_content_hash( // The purpose of including the following selector is to make the message unique to that specific call. Note that // it has nothing to do with calling the function. let selector = comptime { - std::hash::keccak256( + keccak256::keccak256( "swap_private(address,uint256,uint24,address,uint256,bytes32,address)".as_bytes(), 68, )