commit | 858bc65d7485b8af9c49e96d0cf0bf803606a120 | [log] [tgz] |
---|---|---|
author | Chien Wong <m@xv97.com> | Mon Jan 22 20:47:26 2024 +0800 |
committer | Chien Wong <m@xv97.com> | Mon Jan 22 20:47:26 2024 +0800 |
tree | c1eedce7a8f6d743166cbac2357ce9cd1bdf1b26 | |
parent | bf4b5ed7a4e02358cb008bb43c20f5f3c309b7c1 [diff] |
Add comment on impossible overflows Signed-off-by: Chien Wong <m@xv97.com>
diff --git a/library/gcm.c b/library/gcm.c index b31003f..337145b 100644 --- a/library/gcm.c +++ b/library/gcm.c
@@ -542,6 +542,9 @@ (void) output_size; *output_length = 0; + /* Total length is restricted to 2^39 - 256 bits, ie 2^36 - 2^5 bytes + * and AD length is restricted to 2^64 bits, ie 2^61 bytes so neither of + * the two multiplications would overflow. */ orig_len = ctx->len * 8; orig_add_len = ctx->add_len * 8;