Skip to content

aes-gcm: make AesGcm generic around nonce size - #126

Merged
tarcieri merged 2 commits into
masterfrom
aes-gcm/non-96-bit-nonces
Mar 14, 2020
Merged

aes-gcm: make AesGcm generic around nonce size#126
tarcieri merged 2 commits into
masterfrom
aes-gcm/non-96-bit-nonces

Conversation

@tarcieri

Copy link
Copy Markdown
Member

Support for non-96-bit nonces, while still implementing the current Aead interface and type safety for nonce lengths.

@codecov-io

codecov-io commented Mar 14, 2020

Copy link
Copy Markdown

Codecov Report

Merging #126 into master will increase coverage by 0.71%.
The diff coverage is 92.18%.

Impacted file tree graph

@@ Coverage Diff @@## master #126 +/- ##
==========================================
+ Coverage 96.26% 96.98% +0.71% 
==========================================
Files 28 28 Lines 697 730 +33 ==========================================
+ Hits 671 708 +37 + Misses 26 22 -4 
Impacted FilesCoverage Δ
crypto_box/tests/lib.rs95.34% <85.71%> (-4.66%)⬇️
aes-gcm/src/lib.rs90.00% <88.00%> (-4.88%)⬇️
aes-gcm/src/ctr.rs100.00% <100.00%> (ø)
aes-siv/tests/aead.rs100.00% <100.00%> (ø)
chacha20poly1305/tests/lib.rs100.00% <100.00%> (ø)
ring-aead/tests/common/mod.rs100.00% <100.00%> (ø)
ring-aead/src/lib.rs87.09% <0.00%> (+6.45%)⬆️
chacha20poly1305/src/lib.rs100.00% <0.00%> (+16.66%)⬆️
crypto_box/src/lib.rs100.00% <0.00%> (+18.51%)⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a28e70...0b0a23f. Read the comment docs.

@tarcieri

tarcieri commented Mar 14, 2020

Copy link
Copy Markdown
MemberAuthor

The test vectors still pass for 96-bit nonces, however there aren't any for non-96-bit nonces, and I'm not convinced this is correct yet, namely this part:

Screen Shot 2020-03-14 at 9 32 15 AM

It appears after inputting a zero-padded non-96-bit nonce into GHASH, it should also be followed by its length.

Regardless, we should add test vectors for non-96-bit nonces.

@tarcieri
tarcieriforce-pushed the aes-gcm/non-96-bit-nonces branch from d8d2685 to 0b0a23fCompareMarch 14, 2020 16:35
This was referenced Mar 14, 2020
@tarcieri
tarcieriforce-pushed the aes-gcm/non-96-bit-nonces branch from 0b0a23f to fb163e4CompareMarch 14, 2020 17:19
@tarcieri

Copy link
Copy Markdown
MemberAuthor

I added some tests for non-96-bit IVs based on the NIST CAVS vectors and they're presently failing, even after attempting to include the IV length in the GHASH message.

@tarcieri
tarcieriforce-pushed the aes-gcm/non-96-bit-nonces branch from fb163e4 to a128b93CompareMarch 14, 2020 18:33
Support for non-96-bit nonces, while still implementing the current
`Aead` interface and type safety for nonce lengths.
@tarcieri
tarcieriforce-pushed the aes-gcm/non-96-bit-nonces branch from a128b93 to 4dae48bCompareMarch 14, 2020 18:46
@tarcieri
tarcieri marked this pull request as ready for review March 14, 2020 18:47
@tarcieri

Copy link
Copy Markdown
MemberAuthor

Ok, got it working after updating the CTR implementation to parse a base counter value from 𝐉₀

@tarcieri
tarcieri merged commit 8fe8807 into masterMar 14, 2020
@tarcieri
tarcieri deleted the aes-gcm/non-96-bit-nonces branch March 14, 2020 18:53
This was referenced Jun 6, 2020
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.

3 participants

@tarcieri@codecov-io@masihyeganeh