summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/gcm.h
diff options
context:
space:
mode:
authorMichael Brown2022-11-09 17:45:54 +0100
committerMichael Brown2022-11-09 17:48:50 +0100
commit63577207ab95a53b29c1fa441be25ee15747bbe0 (patch)
treeed0b7c1bbc71345cbf40b5b35329caacb8acc5dc /src/include/ipxe/gcm.h
parent[tls] Allow handshake digest algorithm to be specified by cipher suite (diff)
downloadipxe-63577207ab95a53b29c1fa441be25ee15747bbe0.tar.gz
ipxe-63577207ab95a53b29c1fa441be25ee15747bbe0.tar.xz
ipxe-63577207ab95a53b29c1fa441be25ee15747bbe0.zip
[crypto] Ensure relevant GCM cipher state is cleared by cipher_setiv()
Reset the accumulated authentication state when cipher_setiv() is called, to allow the cipher to be reused without resetting the key. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/gcm.h')
-rw-r--r--src/include/ipxe/gcm.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/include/ipxe/gcm.h b/src/include/ipxe/gcm.h
index d93eecd8..90ef0b52 100644
--- a/src/include/ipxe/gcm.h
+++ b/src/include/ipxe/gcm.h
@@ -44,14 +44,14 @@ union gcm_block {
/** GCM context */
struct gcm_context {
- /** Hash key (H) */
- union gcm_block key;
- /** Counter (Y) */
- union gcm_block ctr;
/** Accumulated hash (X) */
union gcm_block hash;
/** Accumulated lengths */
union gcm_block len;
+ /** Counter (Y) */
+ union gcm_block ctr;
+ /** Hash key (H) */
+ union gcm_block key;
/** Underlying block cipher */
struct cipher_algorithm *raw_cipher;
/** Underlying block cipher context */