diff options
author | Bruno Haible <bruno@clisp.org> | 2019-08-24 16:15:02 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2019-08-24 16:15:02 +0200 |
commit | 57959b9e826f42c3aa5bad7efff06e9ad3dc63f6 (patch) | |
tree | 585960a84b3919e661b32b086a3323c8294edd36 | |
parent | 1b88779f4f6cc701aa24007c62b35d3596ce6638 (diff) | |
download | gnulib-57959b9e826f42c3aa5bad7efff06e9ad3dc63f6.tar.gz gnulib-57959b9e826f42c3aa5bad7efff06e9ad3dc63f6.tar.bz2 |
crypto/gc-md2: Optimize and clarify code.
* lib/gc-gnulib.c (gc_hash_open): Comment out md2_init_ctx invocation.
* lib/gc-libgcrypt.c (gc_hash_open): Clarify why md2_init_ctx invocation
is not needed.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/gc-gnulib.c | 3 | ||||
-rw-r--r-- | lib/gc-libgcrypt.c | 4 |
3 files changed, 13 insertions, 1 deletions
@@ -1,5 +1,12 @@ 2019-08-24 Bruno Haible <bruno@clisp.org> + crypto/gc-md2: Optimize and clarify code. + * lib/gc-gnulib.c (gc_hash_open): Comment out md2_init_ctx invocation. + * lib/gc-libgcrypt.c (gc_hash_open): Clarify why md2_init_ctx invocation + is not needed. + +2019-08-24 Bruno Haible <bruno@clisp.org> + crypto/gc-md2: Add comment. * lib/gc-libgcrypt.c: Add comment. diff --git a/lib/gc-gnulib.c b/lib/gc-gnulib.c index 62aa50a2ec..6fcb4a1c87 100644 --- a/lib/gc-gnulib.c +++ b/lib/gc-gnulib.c @@ -646,7 +646,8 @@ gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle) { #if GNULIB_GC_MD2 case GC_MD2: - md2_init_ctx (&ctx->md2Context); + /* Not needed, because ctx is already zero-initialized. */ + /*md2_init_ctx (&ctx->md2Context);*/ break; #endif diff --git a/lib/gc-libgcrypt.c b/lib/gc-libgcrypt.c index 6c95712bf1..fbfd0a138f 100644 --- a/lib/gc-libgcrypt.c +++ b/lib/gc-libgcrypt.c @@ -270,9 +270,13 @@ gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle) switch (hash) { +#if GNULIB_GC_MD2 case GC_MD2: + /* Not needed, because ctx is already zero-initialized. */ + /*md2_init_ctx (&ctx->md2Context);*/ gcryalg = GCRY_MD_NONE; break; +#endif case GC_MD4: gcryalg = GCRY_MD_MD4; |