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

ghash: Split from polyval crate #10

Merged
merged 1 commit into from
Sep 18, 2019
Merged

ghash: Split from polyval crate #10

merged 1 commit into from
Sep 18, 2019

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Sep 18, 2019

This extracts ghash into its own crate.

In attempting to add runtime detection to polyval, having ghash in the same crate felt in-the-way. In this commit, I have split the two crates in advance, and then I'll rebase my runtime detection into its own commit.

I think we only need two crates here, as the ghash crate is implemented in terms of POLYVAL's field/polynomial:

GHASH(H, X_1, ..., X_n) =>
ByteReverse(POLYVAL(mulX_POLYVAL(ByteReverse(H)), ByteReverse(X_1), ..., ByteReverse(X_n)))

Though they both operate over GF(2^128), there are some slight discrepancies in the field arithmetic owing to the polynomial, and this approach leverages the fact that the POLYVAL polynomial is the "reverse" of the GHASH one.

@tarcieri tarcieri requested a review from newpavlov September 18, 2019 19:07
@tarcieri tarcieri force-pushed the ghash branch 3 times, most recently from aa11014 to e1d9219 Compare September 18, 2019 19:16
This extracts `ghash` into its own crate.

In attempting to add runtime detection to `polyval`, having `ghash` in
the same crate felt in-the-way. In this commit, I have split the two
crates in advance, and then I'll rebase my runtime detection into its
own commit.

I think we only need two crates here, as the `ghash` crate is implemented
in terms of POLYVAL's field/polynomial:

`GHASH(H, X_1, ..., X_n)` =>
`ByteReverse(POLYVAL(mulX_POLYVAL(ByteReverse(H)), ByteReverse(X_1), ..., ByteReverse(X_n)))`

Though they are both GF(2^128), there are some slight discrepancies in
the field arithmetic owing to the polynomial, and this approach
leverages the fact that the POLYVAL polynomial is the "reverse" of the
GHASH one.
@tarcieri tarcieri merged commit 1e7d0bd into master Sep 18, 2019
@tarcieri tarcieri deleted the ghash branch September 18, 2019 19:33
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

1 participant