summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/bn/bn_nist.c5
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_nist.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libcrypto/bn/bn_nist.c b/src/lib/libcrypto/bn/bn_nist.c
index 9a0970138d..b16584d6b9 100644
--- a/src/lib/libcrypto/bn/bn_nist.c
+++ b/src/lib/libcrypto/bn/bn_nist.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_nist.c,v 1.17 2016/07/17 22:01:01 bcook Exp $ */ 1/* $OpenBSD: bn_nist.c,v 1.18 2016/07/18 01:04:52 bcook Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Written by Nils Larsch for the OpenSSL project
4 */ 4 */
@@ -570,7 +570,6 @@ BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_CTX *ctx)
570 unsigned int ui[BN_NIST_224_TOP * 570 unsigned int ui[BN_NIST_224_TOP *
571 sizeof(BN_ULONG) / sizeof(unsigned int)]; 571 sizeof(BN_ULONG) / sizeof(unsigned int)];
572 } buf; 572 } buf;
573 memset(&buf, 0, sizeof(buf));
574 BN_ULONG c_d[BN_NIST_224_TOP], *res; 573 BN_ULONG c_d[BN_NIST_224_TOP], *res;
575 uintptr_t mask; 574 uintptr_t mask;
576 union { 575 union {
@@ -605,6 +604,8 @@ BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_CTX *ctx)
605 } else 604 } else
606 r_d = a_d; 605 r_d = a_d;
607 606
607 memset(&buf, 0, sizeof(buf));
608
608#if BN_BITS2==64 609#if BN_BITS2==64
609 /* copy upper 256 bits of 448 bit number ... */ 610 /* copy upper 256 bits of 448 bit number ... */
610 nist_cp_bn_0(c_d, a_d + (BN_NIST_224_TOP - 1), 611 nist_cp_bn_0(c_d, a_d + (BN_NIST_224_TOP - 1),
diff --git a/src/lib/libssl/src/crypto/bn/bn_nist.c b/src/lib/libssl/src/crypto/bn/bn_nist.c
index 9a0970138d..b16584d6b9 100644
--- a/src/lib/libssl/src/crypto/bn/bn_nist.c
+++ b/src/lib/libssl/src/crypto/bn/bn_nist.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_nist.c,v 1.17 2016/07/17 22:01:01 bcook Exp $ */ 1/* $OpenBSD: bn_nist.c,v 1.18 2016/07/18 01:04:52 bcook Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Written by Nils Larsch for the OpenSSL project
4 */ 4 */
@@ -570,7 +570,6 @@ BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_CTX *ctx)
570 unsigned int ui[BN_NIST_224_TOP * 570 unsigned int ui[BN_NIST_224_TOP *
571 sizeof(BN_ULONG) / sizeof(unsigned int)]; 571 sizeof(BN_ULONG) / sizeof(unsigned int)];
572 } buf; 572 } buf;
573 memset(&buf, 0, sizeof(buf));
574 BN_ULONG c_d[BN_NIST_224_TOP], *res; 573 BN_ULONG c_d[BN_NIST_224_TOP], *res;
575 uintptr_t mask; 574 uintptr_t mask;
576 union { 575 union {
@@ -605,6 +604,8 @@ BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_CTX *ctx)
605 } else 604 } else
606 r_d = a_d; 605 r_d = a_d;
607 606
607 memset(&buf, 0, sizeof(buf));
608
608#if BN_BITS2==64 609#if BN_BITS2==64
609 /* copy upper 256 bits of 448 bit number ... */ 610 /* copy upper 256 bits of 448 bit number ... */
610 nist_cp_bn_0(c_d, a_d + (BN_NIST_224_TOP - 1), 611 nist_cp_bn_0(c_d, a_d + (BN_NIST_224_TOP - 1),