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

contracts: add curve25519 pk precompile #116

Merged
merged 1 commit into from
Feb 22, 2023
Merged

Conversation

nhynes
Copy link
Contributor

@nhynes nhynes commented Feb 21, 2023

No description provided.

@nhynes nhynes merged commit e813012 into main Feb 22, 2023
@nhynes nhynes deleted the nhynes/solidity-x25519-keygen branch February 22, 2023 20:58
{
bytes memory scalar = randomBytes(32, pers);
// Twiddle some bits, as per RFC 7748 §5.
scalar[0] &= 0xf8; // Make it a multiple of 8 to avoid small subgroup attacks.
Copy link

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Nice catch, thanks! Can you open up a PR with the proposed fix (removing the scalar clamp)?

@@ -14,12 +14,17 @@ library Sapphire {
0x0100000000000000000000000000000000000003;
address private constant DECRYPT =
0x0100000000000000000000000000000000000004;
address private constant GENERATE_KEYPAIR =
address private constant GENERAGE_SIGNING_KEYPAIR =
Copy link

Choose a reason for hiding this comment

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

Should be GENERATE_SIGNING_KEYPAIR

Copy link
Member

Choose a reason for hiding this comment

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

Indeed! Can you open up a PR with the fix? Thanks a lot!

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.

None yet

3 participants