Skip to content

Commit e3af37c

Browse files
committed
refactor: pedersen hash related cleanup in aztec.nr
1 parent 3d61bdf commit e3af37c

File tree

14 files changed

+18
-38
lines changed

14 files changed

+18
-38
lines changed

noir-projects/aztec-nr/authwit/src/account.nr

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use dep::aztec::context::{PrivateContext, PublicContext};
2-
use dep::aztec::protocol_types::{address::AztecAddress, abis::function_selector::FunctionSelector, hash::pedersen_hash};
1+
use dep::aztec::context::PrivateContext;
32

43
use crate::entrypoint::{app::AppPayload, fee::FeePayload};
54
use crate::auth::{IS_VALID_SELECTOR, compute_authwit_message_hash};

noir-projects/aztec-nr/aztec/src/oracle/get_nullifier_membership_witness.nr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use dep::protocol_types::{
22
abis::nullifier_leaf_preimage::{NullifierLeafPreimage, NULLIFIER_LEAF_PREIMAGE_LENGTH},
3-
constants::NULLIFIER_TREE_HEIGHT, hash::pedersen_hash, utils::arr_copy_slice
3+
constants::NULLIFIER_TREE_HEIGHT, utils::arr_copy_slice
44
};
55

66
// INDEX_LENGTH + NULLIFIER_LEAF_PREIMAGE_LENGTH + NULLIFIER_TREE_HEIGHT

noir-projects/aztec-nr/aztec/src/oracle/get_public_data_witness.nr

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use dep::protocol_types::{
2-
constants::PUBLIC_DATA_TREE_HEIGHT, hash::pedersen_hash,
3-
public_data_tree_leaf_preimage::PublicDataTreeLeafPreimage, traits::{Hash, Serialize},
2+
constants::PUBLIC_DATA_TREE_HEIGHT, public_data_tree_leaf_preimage::PublicDataTreeLeafPreimage,
43
utils::arr_copy_slice
54
};
65

noir-projects/aztec-nr/aztec/src/state_vars/map.nr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use dep::protocol_types::{hash::pedersen_hash, storage::map::derive_storage_slot_in_map, traits::ToField};
1+
use dep::protocol_types::{storage::map::derive_storage_slot_in_map, traits::ToField};
22
use crate::state_vars::storage::Storage;
33

44
// docs:start:map

noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/shared_mutable_private_getter.nr

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
use dep::protocol_types::{
2-
hash::{pedersen_hash, poseidon2_hash}, traits::{FromField, ToField}, address::AztecAddress,
3-
header::Header
4-
};
1+
use dep::protocol_types::{traits::{FromField, ToField}, address::AztecAddress, header::Header};
52

6-
use crate::context::PrivateContext;
7-
use crate::state_vars::{
8-
storage::Storage,
9-
shared_mutable::{
10-
shared_mutable::SharedMutable, scheduled_delay_change::ScheduledDelayChange,
11-
scheduled_value_change::ScheduledValueChange
12-
}
13-
};
3+
use crate::{context::PrivateContext, state_vars::shared_mutable::shared_mutable::SharedMutable};
144

155
struct SharedMutablePrivateGetter<T, INITIAL_DELAY> {
166
context: &mut PrivateContext,

noir-projects/noir-contracts/contracts/test_contract/src/test_note.nr

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use dep::aztec::{
2-
note::{note_header::NoteHeader, note_interface::NoteInterface}, hash::pedersen_hash,
3-
context::PrivateContext
4-
};
1+
use dep::aztec::{note::{note_header::NoteHeader, note_interface::NoteInterface}, context::PrivateContext};
52

63
global TEST_NOTE_LEN: Field = 1;
74
// TEST_NOTE_LENGTH * 32 + 32(storage_slot as bytes) + 32(note_type_id as bytes)

noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use dep::aztec::prelude::{AztecAddress, NoteGetterOptions, NoteViewerOptions, NoteHeader, NoteInterface, PrivateSet, Map};
22
use dep::aztec::{
3-
context::{PrivateContext, UnconstrainedContext}, hash::pedersen_hash,
3+
context::{PrivateContext, UnconstrainedContext},
44
protocol_types::constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,
55
note::{note_getter::view_notes, note_getter_options::SortOrder, note_emission::OuterNoteEmission}
66
};

noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use dep::aztec::prelude::{AztecAddress, NoteGetterOptions, NoteViewerOptions, NoteHeader, NoteInterface, PrivateSet, Map};
22
use dep::aztec::{
3-
context::{PrivateContext, UnconstrainedContext}, hash::pedersen_hash,
3+
context::{PrivateContext, UnconstrainedContext},
44
protocol_types::constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,
55
note::{
66
note_getter::view_notes, note_getter_options::SortOrder,

noir-projects/noir-contracts/contracts/token_with_refunds_contract/src/types/balances_map.nr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use dep::aztec::prelude::{AztecAddress, NoteGetterOptions, NoteViewerOptions, NoteHeader, NoteInterface, PrivateSet, Map};
22
use dep::aztec::{
3-
context::{PrivateContext, UnconstrainedContext}, hash::pedersen_hash,
3+
context::{PrivateContext, UnconstrainedContext},
44
protocol_types::constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,
55
note::{
66
note_getter::view_notes, note_getter_options::SortOrder,

noir-projects/noir-protocol-circuits/crates/types/src/abis/gas.nr

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use crate::{
22
abis::function_selector::FunctionSelector, address::{EthAddress, AztecAddress},
3-
constants::{GAS_LENGTH, FIXED_DA_GAS, FIXED_L2_GAS}, hash::pedersen_hash,
4-
traits::{Deserialize, Hash, Serialize, Empty}, abis::side_effect::Ordered, utils::reader::Reader,
5-
abis::gas_fees::GasFees
3+
constants::{GAS_LENGTH, FIXED_DA_GAS, FIXED_L2_GAS}, traits::{Deserialize, Hash, Serialize, Empty},
4+
abis::side_effect::Ordered, utils::reader::Reader, abis::gas_fees::GasFees
65
};
76
use std::ops::{Add, Sub};
87

noir-projects/noir-protocol-circuits/crates/types/src/abis/gas_fees.nr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
22
abis::function_selector::FunctionSelector, address::{EthAddress, AztecAddress},
3-
constants::GAS_FEES_LENGTH, hash::pedersen_hash, traits::{Deserialize, Hash, Serialize, Empty},
3+
constants::GAS_FEES_LENGTH, traits::{Deserialize, Hash, Serialize, Empty},
44
abis::side_effect::Ordered, utils::reader::Reader
55
};
66

noir-projects/noir-protocol-circuits/crates/types/src/abis/gas_settings.nr

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ use crate::{
55
GAS_SETTINGS_LENGTH, DEFAULT_GAS_LIMIT, DEFAULT_TEARDOWN_GAS_LIMIT, DEFAULT_MAX_FEE_PER_GAS,
66
DEFAULT_INCLUSION_FEE
77
},
8-
hash::pedersen_hash, traits::{Deserialize, Hash, Serialize, Empty}, abis::side_effect::Ordered,
9-
utils::reader::Reader
8+
traits::{Deserialize, Hash, Serialize, Empty}, abis::side_effect::Ordered, utils::reader::Reader
109
};
1110

1211
struct GasSettings {

noir-projects/noir-protocol-circuits/crates/types/src/address/eth_address.nr

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use crate::{
2-
constants::ETH_ADDRESS_LENGTH, hash::pedersen_hash,
3-
traits::{Empty, ToField, Serialize, Deserialize}, utils
4-
};
1+
use crate::{constants::ETH_ADDRESS_LENGTH, traits::{Empty, ToField, Serialize, Deserialize}, utils};
52

63
struct EthAddress{
74
inner : Field

yarn-project/end-to-end/src/e2e_keys.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ describe('Key Registry', () => {
5050
afterAll(() => teardown());
5151

5252
describe('using nsk_app to detect nullification', () => {
53-
// This test checks that it possible to detect that a note has been nullified just by using nsk_app. Note that
54-
// this only works for non-transient notes as transient ones never emit a note hash which makes it impossible
55-
// to brute force their nullifier.
53+
// This test checks that it is possible to detect that a note has been nullified just by using nsk_app. Note
54+
// that this only works for non-transient notes as transient ones never emit a note hash which makes it
55+
// impossible to brute force their nullifier.
5656
// This might seem to make the scheme useless in practice. This could not be the case because if you have
5757
// a note of funds, when you create the transient you are nullifying that note. So even if I cannot see when you
5858
// nullified the transient ones, I can see that you nullified the first.

0 commit comments

Comments
 (0)