-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "refactor: tagging cleanup (#10675)"
This reverts commit 52b541a.
- Loading branch information
Showing
19 changed files
with
157 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 0 additions & 40 deletions
40
yarn-project/circuits.js/src/structs/indexed_tagging_secret.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { type AztecAddress } from '@aztec/foundation/aztec-address'; | ||
import { poseidon2Hash } from '@aztec/foundation/crypto'; | ||
import { Fr } from '@aztec/foundation/fields'; | ||
|
||
export class IndexedTaggingSecret { | ||
constructor(public secret: Fr, public index: number) {} | ||
|
||
toFields(): Fr[] { | ||
return [this.secret, new Fr(this.index)]; | ||
} | ||
|
||
static fromFields(serialized: Fr[]) { | ||
return new this(serialized[0], serialized[1].toNumber()); | ||
} | ||
|
||
computeTag(recipient: AztecAddress) { | ||
return poseidon2Hash([this.secret, recipient, this.index]); | ||
} | ||
|
||
computeSiloedTag(recipient: AztecAddress, contractAddress: AztecAddress) { | ||
const tag = this.computeTag(recipient); | ||
return poseidon2Hash([contractAddress, tag]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.