aws / aws/aws-lc

Allow nonce reuse

Open
#3,326 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Assembly
Stars
830
Forks
212
Avg merge
2d 22h
Merged PRs (30d)
61

Description

### Problem:

Use-case: on a signal, I want to send A xor B message immediately. To save on the TLS encryption, I want to encrypt both messages beforehand, with the same nonce. crypto/fipsmodule/cipher/e_aes.c prevents this.

### Solution:

In crypto/fipsmodule/cipher/e_aes.c, remove the `given_counter < gcm_ctx->min_next_nonce` check. (the min_next_nonce field can be removed compleltey)

The change is trivial, but I do not understand why the check is there on the first place. To protect the user against accidental misuse? I can prepare an MR.

* **Does this change any public APIs?**

No

* **Which algorithm(s) will this impact?**

AES

Contributor guide

Open the contributing guide

Research direction

Start in crypto/fipsmodule/cipher/e_aes.c and inspect the given_counter < gcm_ctx->min_next_nonce check and the min_next_nonce field. Confirm the reason for the nonce-reuse restriction and review the relevant AES-GCM behavior before changing it; done means the proposed reuse is allowed without changing public APIs.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cryptography, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.