Skip to content
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

Update to use Monty represenation for all 256 bit operations. #50

Merged
merged 11 commits into from
Jan 29, 2019

Conversation

coltfred
Copy link
Member

  • Update to use Monty once we get to the internal types.

@@ -19,7 +19,7 @@ lazy_static = "~1.2"
arrayvec = "~0.4"
ed25519-dalek = "1.0.0-pre.1"
clear_on_drop = "~0.2"
gridiron = "0.5.0"
gridiron = "0.5.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just depend on "0.5" or "~0.5"?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we did that it wouldn't actually work on 0.5.0, but maybe that's ok...

Copy link
Contributor

Choose a reason for hiding this comment

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

I was just thinking we'd want to get new patch updates. Not sure what to say about 0.5.0 though...

@@ -37,6 +37,23 @@ impl BytesDecoder for Fp256 {
}
}

impl BytesDecoder for gridiron::fp_256::Monty {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we've been preferring the non ArrayVec implementation of this. See BytesDecoder for Fp480. Now that we have 3 of these, is it time to introduce a macro to reduce duplication?

Copy link
Member Author

Choose a reason for hiding this comment

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

I propose we use arrayvec to shorten the code.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a nice improvement. Will you fix the Fp480 instance below to maintain consistency? Or we can do it another PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll fix it in my next pr.

src/lib.rs Outdated Show resolved Hide resolved
src/internal/field.rs Outdated Show resolved Hide resolved
src/api.rs Outdated Show resolved Hide resolved
src/api.rs Outdated Show resolved Hide resolved
src/api.rs Outdated
@@ -18,6 +18,7 @@ pub use crate::internal::ByteVector;
use crate::nonemptyvec::NonEmptyVec;
use crate::Revealed;
use clear_on_drop::clear::Clear;
use gridiron::fp_256;
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that I'm seeing Monty in use, I wish the fp31 macro enabled us to set the name for the Montgomery Form type.
I think something like Fp256M or Fp256MF is nicer than fp_256::Monty, especially next to the "standard form" type of Fp256

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed it to Monty256

src/internal/curve.rs Outdated Show resolved Hide resolved
src/internal/hashable.rs Show resolved Hide resolved
Copy link
Contributor

@clintfred clintfred left a comment

Choose a reason for hiding this comment

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

Ask for one maintenance issue, but looking good!

As for the Monty256 rename, I like that better. I'm not sure it's the final/best solution, but I'm fine with it unless you come up with something better.

@@ -37,6 +37,23 @@ impl BytesDecoder for Fp256 {
}
}

impl BytesDecoder for gridiron::fp_256::Monty {
Copy link
Contributor

Choose a reason for hiding this comment

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

That's a nice improvement. Will you fix the Fp480 instance below to maintain consistency? Or we can do it another PR.

@@ -19,7 +19,7 @@ lazy_static = "~1.2"
arrayvec = "~0.4"
ed25519-dalek = "1.0.0-pre.1"
clear_on_drop = "~0.2"
gridiron = "0.5.0"
gridiron = "0.5.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

I was just thinking we'd want to get new patch updates. Not sure what to say about 0.5.0 though...

@coltfred coltfred merged commit 9f3d3a7 into master Jan 29, 2019
@ernieturner ernieturner deleted the monty_256 branch February 21, 2019 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants