]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Delete _ghash_digest.
authorNiels Möller <nisse@lysator.liu.se>
Sat, 19 Feb 2022 19:45:37 +0000 (20:45 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Sat, 19 Feb 2022 19:45:37 +0000 (20:45 +0100)
ChangeLog
gcm.c
ghash-internal.h
ghash-set-key.c
x86_64/pclmul/ghash-update.asm

index 6af86dda0b32f330f9400390600b1033672a94ba..b53298e9cc5122c192c6281d689be0782c80d018 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2022-02-19  Niels Möller  <nisse@lysator.liu.se>
 
+       * ghash-set-key.c (_ghash_digest): Deleted, and also deleted
+       assembly implementations.
+       * gcm.c (gcm_digest): Replace call to _ghash_digest with block16_xor.
+
        * x86_64/pclmul/gcm-hash.asm: Deleted, split into two new files...
        * x86_64/pclmul/ghash-set-key.asm: New file.
        * x86_64/pclmul/ghash-update.asm: New file.
diff --git a/gcm.c b/gcm.c
index cccac08f1e5a9e4163eda291e9fb11191d98a9cd..5de8abb21570e2c400ff525fcd0d7225501e550c 100644 (file)
--- a/gcm.c
+++ b/gcm.c
@@ -258,7 +258,7 @@ gcm_digest(struct gcm_ctx *ctx, const struct gcm_key *key,
   gcm_hash_sizes(key, &ctx->x, ctx->auth_size, ctx->data_size);
 
   f (cipher, GCM_BLOCK_SIZE, buffer.b, ctx->iv.b);
-  _ghash_digest (&ctx->x, &buffer);
+  block16_xor (&buffer, &ctx->x);
   memcpy (digest, buffer.b, length);
 
   return;
index d0bfae1e2d00fa14d026dafe34a025514adc0975..97dff0243fc3126240a71cfb017738dd28a4aa93 100644 (file)
@@ -38,7 +38,6 @@
 /* Name mangling */
 #define _ghash_set_key _nettle_ghash_set_key
 #define _ghash_update _nettle_ghash_update
-#define _ghash_digest _nettle_ghash_digest
 
 #ifdef __cplusplus
 extern "C" {
@@ -46,9 +45,7 @@ extern "C" {
 
 /* The CTX a struct gcm_key (even if struct ghash_key might be a more
  * appropriate name). An array of blocks, exact contents depends on
- * the implementation. STATE is only a single block. Initial state is
- * all zero, otherwise, usage (e.g., byte order) depends on
- * implementation. */
+ * the implementation. STATE is only a single block. */
 
 /* Expands KEY as needed, for corresponding _ghash_update */
 void
@@ -61,10 +58,6 @@ const uint8_t *
 _ghash_update (const struct gcm_key *ctx, union nettle_block16 *state,
               size_t blocks, const uint8_t *data);
 
-/* Produces final digest, and XORS into the digest block. */
-void 
-_ghash_digest (const union nettle_block16 *state, union nettle_block16 *digest);
-
 #ifdef __cplusplus
 }
 #endif
index fa3c55887886c851b08c1c6240e5c0cc44345307..e8813a5ef98fbea59c9506b2d4d0f8a58afe83de 100644 (file)
@@ -66,9 +66,3 @@ _ghash_set_key (struct gcm_key *ctx, const union nettle_block16 *key)
        block16_xor3 (&ctx->h[i+j], &ctx->h[i], &ctx->h[j]);
     }
 }
-
-void
-_ghash_digest (const union nettle_block16 *state, union nettle_block16 *digest)
-{
-  block16_xor (digest, state);
-}
index 8a13958aca160d29f4639b47c2b3ad8e45a6fcaa..abb7865d58d22be8bada8d2b880de3d8c43a38b4 100644 (file)
@@ -123,21 +123,6 @@ PROLOGUE(_nettle_ghash_update)
        ret
 EPILOGUE(_nettle_ghash_update)
 
-       C void _ghash_digest (const union nettle_block16 *state,
-       C                     union nettle_block16 *digest)
-       C state in %rdi, digest in %rsi
-PROLOGUE(_nettle_ghash_digest)
-       W64_ENTRY(2)
-       mov     (%rsi), %rax
-       mov     8(%rsi), %rdx
-       xor     (%rdi), %rax
-       xor     8(%rdi), %rdx
-       mov     %rax, (%rsi)
-       mov     %rdx, 8(%rsi)
-       W64_EXIT(2)
-       ret
-EPILOGUE(_nettle_ghash_digest)
-
        RODATA
        C The GCM polynomial is x^{128} + x^7 + x^2 + x + 1,
        C but in bit-reversed representation, that is