Skip to content

Commit

Permalink
Use memset in bn_mont
Browse files Browse the repository at this point in the history
Use memset() not inline code.  Compilers are smarter now.

Reviewed-by: Richard Levitte <levitte@openssl.org>
  • Loading branch information
Rich Salz committed Feb 5, 2015
1 parent 8dd94af commit fe6d2a3
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions crypto/bn/bn_mont.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,7 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
rp = r->d;

/* clear the top words of T */
# if 1
for (i = r->top; i < max; i++) /* memset? XXX */
rp[i] = 0;
# else
memset(&(rp[r->top]), 0, (max - r->top) * sizeof(BN_ULONG));
# endif

r->top = max;
n0 = mont->n0[0];
Expand Down

0 comments on commit fe6d2a3

Please sign in to comment.