Skip to content

bignp256: migrate to LittleEndian, according to specification#1684

Merged
tarcieri merged 2 commits intoRustCrypto:masterfrom
makavity:master
Mar 22, 2026
Merged

bignp256: migrate to LittleEndian, according to specification#1684
tarcieri merged 2 commits intoRustCrypto:masterfrom
makavity:master

Conversation

@makavity
Copy link
Copy Markdown
Contributor

Hello!
Just migrated BigEndian to LittleEndian, according to specification.

Also, there is testing methodics from Belarusian State University.

Here is the example for bign256 of signature generation:
image

For that, i've edited the monty.rs file, typed about that in #elliptic-curves > bignp256 - migrate to LE

@tarcieri

@makavity
Copy link
Copy Markdown
Contributor Author

Also, it is blocked by RustCrypto/signatures#1109

Comment thread primefield/src/monty.rs
Comment on lines 89 to +258
@@ -247,7 +252,10 @@ where
}
ByteOrder::LittleEndian => {
let padded = self.inner.retrieve().to_le_byte_array();
repr.copy_from_slice(&padded[..offset]);
// For little-endian encoding we expose the least-significant bytes
// at the beginning of the representation.
let len = repr.len();
repr.copy_from_slice(&padded[..len]);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be good if you can split these bugfix changes to primefield out into a separate PR and add a regression test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will do it tomorrow

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@makavity
Copy link
Copy Markdown
Contributor Author

@tarcieri i think it would be great to release it before 0.14, bcs the breaking changes

@tarcieri tarcieri merged commit a554101 into RustCrypto:master Mar 22, 2026
159 checks passed
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