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

[WIP] p521: impl FieldElement::invert #787

Closed
wants to merge 1 commit into from

Conversation

tarcieri
Copy link
Member

Warning: broken! Do not use.

Adapts the addition chain generated by addchain into Rust:

https://github.com/mmcloughlin/addchain

Not working for some reason (possibly an issue with the fiat-crypto field arithmetic)

test arithmetic::field::tests::invert ... FAILED

failures:

---- arithmetic::field::tests::invert stdout ----
thread 'arithmetic::field::tests::invert' panicked at 'assertion failed: `(left == right)`
  left: `FieldElement([0, 0, 288230376151711744, 288230376151711743, 288230376151711743, 288230376151711743, 288230376151711743, 288230376151711743, 144115188075855871])`,
 right: `FieldElement([1, 0, 0, 0, 0, 0, 0, 0, 0])`', p521/src/arithmetic/field.rs:600:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Warning: broken! Do not use.

Adapts the addition chain generated by `addchain` into Rust:

https://github.com/mmcloughlin/addchain

Not working for some reason (possibly an issue with the fiat-crypto
field arithmetic)

test arithmetic::field::tests::invert ... FAILED

failures:

---- arithmetic::field::tests::invert stdout ----
thread 'arithmetic::field::tests::invert' panicked at 'assertion failed: `(left == right)`
  left: `FieldElement([0, 0, 288230376151711744, 288230376151711743, 288230376151711743, 288230376151711743, 288230376151711743, 288230376151711743, 144115188075855871])`,
 right: `FieldElement([1, 0, 0, 0, 0, 0, 0, 0, 0])`', p521/src/arithmetic/field.rs:600:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
tarcieri added a commit that referenced this pull request Nov 2, 2023
@tarcieri
Copy link
Member Author

tarcieri commented Nov 2, 2023

Closing in favor of #946

@tarcieri tarcieri closed this Nov 2, 2023
@tarcieri tarcieri deleted the p521/field-element-invert branch November 2, 2023 16:27
tarcieri added a commit that referenced this pull request Nov 2, 2023
…946)

Implements `sqrt` using Shank's algorithm, and `invert` using an addition chain
originally from #787.

Changes the `ConstantTimeEq` implementation to compare `FieldElement`s
using `fiat_p521_to_bytes` output.

Also adds basic tests for various field constants.
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.

1 participant