Skip to content

ghash: add FieldElement - #356

Merged
tarcieri merged 3 commits into
RustCrypto:masterfrom
makavity:master
Aug 28, 2026
Merged

ghash: add FieldElement#356
tarcieri merged 3 commits into
RustCrypto:masterfrom
makavity:master

Conversation

@makavity

Copy link
Copy Markdown
Contributor

@makavity

Copy link
Copy Markdown
ContributorAuthor

@tarcieri tried to implement belt-dwp with that terms.
Unfortunately, i can't do it clearly without convertations like that:

#[inline(always)]fnconvert(x:u128) -> u128{
x.reverse_bits().swap_bytes()}#[inline(always)]fnconvert_block(block:&Block) -> Block{convert(u128::from_le_bytes((*block).into())).to_le_bytes().into()}

Because STB spec works in different notation.
If it is okay - i'll correct my PR for belt-dwp.

@tarcieri

Copy link
Copy Markdown
Member

Heh, I had a half-finished version of this locally too, but we can go with this.

Because STB spec works in different notation.

Wait, it uses GHASH, but in little endian? Weird. Unfortunate they didn't use POLYVAL if they wanted little endian.

Comment threadghash/src/field_element.rs Outdated
Comment threadghash/src/field_element.rs Outdated
@makavity

Copy link
Copy Markdown
ContributorAuthor

Wait, it uses GHASH, but in little endian? Weird. Unfortunate they didn't use POLYVAL if they wanted little endian.

Yeah, unfortunately :(

Comment threadghash/src/field_element.rs
@tarcieri
tarcieri merged commit aa3e157 into RustCrypto:masterAug 28, 2026
51 checks passed
Sign up for freeto 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

@makavity@tarcieri