Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

feat!: Add Keccak constraints #150

Merged
merged 6 commits into from
May 5, 2023
Merged

feat!: Add Keccak constraints #150

merged 6 commits into from
May 5, 2023

Conversation

guipublic
Copy link
Collaborator

This PR includes Keccak constraints when it serialise an ACIR circuit having Keccak opcodes.
It must be used with a Barretenberg version which handle them (cf. AztecProtocol/barretenberg#393)

Copy link
Member

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't currently implement support for keccak in the PartialWitnessGenerator

@guipublic
Copy link
Collaborator Author

This doesn't currently implement support for keccak in the PartialWitnessGenerator

Indeed, it is not needed to be done here, the support is done on ACVM. I will also remove the other functions (except pedersen) and put them in ACVM.

@kevaundray
Copy link
Collaborator

@TomAFrench I have renamed the HashConstraint struct to be Keccak256Constraint.

Since the pwg function for Keccak256 was put in after the fallible traits, PR 151 would be a blocker for the Keccak256 opcode unless we just implemented the Keccak256 functionality in aztec_backend until we can land acvm >0.11. I left a comment here on 151 and spoke to @phated on slack. I went with re-implementing it in here so we don't rush 151 and have it come out in a less than ideal state, coupled with the fact that the change is isolated and mild.

Let me know your thoughts on this

@TomAFrench
Copy link
Member

TomAFrench commented May 5, 2023

Looks good but I think we expose keccak256 from ACVM now so we can remove the vendored code. Will do that now.

Ah, we haven't updated to ACVM 0.11.0 yet.

Copy link
Member

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this locally and it works so should work in CI

@TomAFrench TomAFrench enabled auto-merge May 5, 2023 09:48
@TomAFrench
Copy link
Member

We should add a simple testcase for a keccak constraint. I'm ok with delaying this as we want to get this out for nouns though.

@TomAFrench TomAFrench added this pull request to the merge queue May 5, 2023
Merged via the queue into master with commit ce2b9ed May 5, 2023
5 checks passed
@TomAFrench TomAFrench deleted the gd/keccak4 branch May 5, 2023 10:49
@github-actions github-actions bot mentioned this pull request May 10, 2023
TomAFrench added a commit that referenced this pull request May 12, 2023
* acvm-0.12.0:
  fix bad rebase
  chore: Release 0.1.2 (#183)
  fix: Remove star dependencies to allow publishing (#182)
  chore: Release 0.1.1 (#181)
  fix: Add description so crate can be published (#180)
  chore: update readme to new name and add contract note (#177)
  feat!: update to acvm with non-homogeneous bb calls (#169)
  update to latest changes
  chore: Release 0.1.0 (#173)
  use patch syntax
  chore: update to use new black box solver interface
  feat!: update to target acvm-84b5d18d
  chore(ci): Update tokens (#174)
  chore: Add release-please and publish workflows to project (#172)
  feat!: Update to ACVM v0.11.0 (#151)
  chore: remove usage of `std::mem::forget` (#164)
  chore: Enforce proper conversion of memory into fixed length array (#163)
  chore: Add test for Keccak256 constraint (#158)
  chore: use `WASMValue` for wasm arguments as well as return values (#157)
  feat!: Add Keccak constraints (#150)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants