-
Notifications
You must be signed in to change notification settings - Fork 153
upgrade arc_ec to v0.4 #110
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
Conversation
|
BTW we also have a preliminary branch to do PST on the other base - commit in G2 opening in G1 - if you are interested |
|
had a look at the multilinear PST, lgtm |
mmagician
left a comment
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.
mostly looks good! I left a few cleanup comments
| fn serialize_uncompressed<W: Write>(&self, writer: W) -> Result<(), SerializationError> { | ||
| Self::serialize_with_mode(&self, writer, Compress::No) |
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.
We can skip this, as the default in ark-serialize is already using:
self.serialize_with_mode(writer, Compress::No)
| self.h.serialize_uncompressed(&mut writer)?; | ||
| self.beta_h.serialize_uncompressed(&mut writer)?; | ||
| self.neg_powers_of_h.serialize_uncompressed(&mut writer) | ||
| fn serialize_compressed<W: Write>(&self, writer: W) -> Result<(), SerializationError> { |
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.
ditto
| fn deserialize_uncompressed<R: Read>(mut reader: R) -> Result<Self, SerializationError> { | ||
| Self::deserialize_with_mode(&mut reader, Compress::No, ark_serialize::Validate::Yes) | ||
| } | ||
| fn deserialize_compressed<R: Read>(mut reader: R) -> Result<Self, SerializationError> { | ||
| Self::deserialize_with_mode(&mut reader, Compress::Yes, ark_serialize::Validate::Yes) | ||
| } | ||
| fn deserialize_compressed_unchecked<R: Read>( | ||
| mut reader: R, | ||
| ) -> Result<Self, SerializationError> { | ||
| Self::deserialize_with_mode(&mut reader, Compress::Yes, ark_serialize::Validate::No) | ||
| } | ||
| fn deserialize_uncompressed_unchecked<R: Read>( | ||
| mut reader: R, | ||
| ) -> Result<Self, SerializationError> { | ||
| Self::deserialize_with_mode(&mut reader, Compress::No, ark_serialize::Validate::No) |
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.
ditto
| fn serialize_uncompressed<W: Write>(&self, mut writer: W) -> Result<(), SerializationError> { | ||
| self.powers_of_g.serialize_uncompressed(&mut writer)?; | ||
| self.powers_of_gamma_g.serialize_uncompressed(&mut writer) | ||
| fn serialize_compressed<W: Write>(&self, writer: W) -> Result<(), SerializationError> { |
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.
here too
| powers_of_g: Cow::Owned(powers_of_g), | ||
| powers_of_gamma_g: Cow::Owned(powers_of_gamma_g), | ||
| }) | ||
| fn deserialize_compressed<R: Read>(mut reader: R) -> Result<Self, SerializationError> { |
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.
and here
| prepared_h, | ||
| prepared_beta_h, | ||
| }) | ||
| fn deserialize_compressed<R: Read>(reader: R) -> Result<Self, SerializationError> { |
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.
ditto
| self.beta_h.serialize_unchecked(&mut writer)?; | ||
| self.num_vars.serialize_unchecked(&mut writer)?; | ||
| self.max_degree.serialize_unchecked(&mut writer) | ||
| fn serialize_uncompressed<W: Write>(&self, mut writer: W) -> Result<(), SerializationError> { |
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.
ditto
| self.num_vars.serialize_unchecked(&mut writer)?; | ||
| self.supported_degree.serialize_unchecked(&mut writer)?; | ||
| self.max_degree.serialize_unchecked(&mut writer) | ||
| fn serialize_uncompressed<W: Write>(&self, writer: W) -> Result<(), SerializationError> { |
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.
ditto
| impl<E: Pairing> Valid for VerifierKey<E> { | ||
| fn check(&self) -> Result<(), SerializationError> { | ||
| if self.num_vars == 0 { | ||
| return Err(SerializationError::InvalidData); |
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.
it's a shame we can't add an error message here. Perhaps it would be worthwhile to pass a message to SerializationError::InvalidData enum variant, but that requires an upstream change in ark-serialise. I'll open an issue on it, maybe we can improve it for the next release.
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.
| + self.max_degree.serialized_size(compress) | ||
| } | ||
|
|
||
| fn serialize_compressed<W: Write>(&self, writer: W) -> Result<(), SerializationError> { |
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.
ditto
|
I moved the commits to #112, which is merged now; thanks everyone for the work! |
Description
Bring the crate to use ark_ec v0.4
closes: #XXXX
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Pendingsection inCHANGELOG.mdFiles changedin the Github PR explorer