-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Hashes - ARC-81 #2588
base: staging
Are you sure you want to change the base?
Hashes - ARC-81 #2588
Conversation
.fold(0, |acc, (i, bit)| if bit.eject_value() { acc | (1 << i) } else { acc }); | ||
|
||
let value = console::types::U8::new(value); | ||
circuit::Plaintext::Literal( |
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 don't believe this circuit is constrained sufficiently. You'll need to use the from_bits
and to_bits
utilities.
@@ -256,14 +462,9 @@ impl<N: Network, const VARIANT: u8> HashInstruction<N, VARIANT> { | |||
(_, PlaintextType::Struct(..)) => bail!("Cannot hash into a struct"), | |||
(_, PlaintextType::Array(..)) => bail!("Cannot hash into an array (yet)"), | |||
}; | |||
// Cast the output to the destination type. | |||
let output = match self.destination_type { |
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.
Generally, it would nice to have fewer deltas on the variants that are not being changed.
Thanks @anstylian for taking an attempt at ARC-81! I think this approach will need careful consideration before we move forward. Specifically we'd like to:
|
Motivation
This pull request introduces changes to the Hash instructions in the
synthesizer/program/src/logic/instruction/operation/hash.rs
file. The main focus is on improving the handling of destination types and adding support for additional array types in hashing operations (sha3 and keccak).It is a step forward for the implementation of ARC-81.
Test Plan
Let me know how you prefer to test this