-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(avm): poseidon2 in vm2 #11597
feat(avm): poseidon2 in vm2 #11597
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
5a378e0
to
d916f01
Compare
d916f01
to
c176d6c
Compare
038aa43
to
9e80f24
Compare
35fce8a
to
b103a20
Compare
9e80f24
to
8ea0328
Compare
b103a20
to
7883080
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will leave some more useful comments tomorrow!
// Alpha (exponentiation): 5 | ||
namespace poseidon2_params; | ||
// Internal Matrix Diagonal (for partial rounds) | ||
pol MU_0 = 7626475329478847982857743246276194948757851985510858890691733676098590062311; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Jean was suggesting we put these (well, for ECC) in the aztec constants so that you can use them both in PIL and C++? no strong preference from my side but worth considering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm i think this is fine as is. They're already available in cpp through bb in nicer hex form anyways, while in PIL they need to be in this decimal format.
barretenberg/cpp/src/barretenberg/crypto/poseidon2/poseidon2.test.cpp
Outdated
Show resolved
Hide resolved
7883080
to
73f9803
Compare
0b4fd1c
to
09bac87
Compare
73f9803
to
dece8ee
Compare
09bac87
to
7bd3cc6
Compare
7bd3cc6
to
2df2297
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good in general! Leaving the constraints to Jean.
} // namespace bb::avm2::simulation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
std::vector<Poseidon2PermutationEvent> event_results = perm_event_emitter.dump_events(); | ||
|
||
EXPECT_EQ(result, expected); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should still use a container matcher. If you want to reuse your expected
variable, you can use ElementsAreArray()
. Same in the other EXPECT_EQ against expected. (and in other tests).
2df2297
to
3b7e83a
Compare
3b7e83a
to
ee53456
Compare
Please read contributing guidelines and remove this line.