Skip to content

polyval: impl Reset#157

Merged
tarcieri merged 1 commit intomasterfrom
polyval/impl-reset
Jul 20, 2022
Merged

polyval: impl Reset#157
tarcieri merged 1 commit intomasterfrom
polyval/impl-reset

Conversation

@tarcieri
Copy link
Member

This is useful in the implementation of aes-gcm-siv, as it allows for calling the newly re-added finalize_reset method, which is useful to avoid consuming self when computing the tag.

SIV mode encryption requires first computing the tag as a pass of POLYVAL over the plaintext, where the tag also functions as a synthetic initialization vector. With AES-GCM-SIV specifically, it also needs access to the original nonce, which is XORed into the tag.

Consuming self means it's not possible to store the cipher, POLYVAL, and nonce in the same struct, since after computing the SIV tag it needs to be passed to the cipher.

This is useful in the implementation of `aes-gcm-siv`, as it allows for
calling the newly re-added `finalize_reset` method, which is useful to
avoid consuming `self` when computing the tag.

SIV mode encryption requires first computing the tag as a pass of
POLYVAL over the plaintext, where the tag also functions as a synthetic
initialization vector. With AES-GCM-SIV specifically, it also needs
access to the original nonce, which is XORed into the tag.

Consuming `self` means it's not possible to store the cipher, POLYVAL,
and nonce in the same struct, since after computing the SIV tag it needs
to be passed to the cipher.
@tarcieri tarcieri merged commit d3f7b35 into master Jul 20, 2022
@tarcieri tarcieri deleted the polyval/impl-reset branch July 20, 2022 14:44
@tarcieri tarcieri mentioned this pull request Jul 31, 2022
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