소스 검색

Use bn_resize_words in BN_from_montgomery_word.

Saves a bit of work, and we get a width sanity-check.

Bug: 232
Change-Id: I1c6bc376c9d8aaf60a078fdc39f35b6f44a688c6
Reviewed-on: https://boringssl-review.googlesource.com/25251
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 6 년 전
committed by Adam Langley
부모
커밋
7979dbede2
1개의 변경된 파일1개의 추가작업 그리고 6개의 파일을 삭제
  1. +1
    -6
      crypto/fipsmodule/bn/montgomery.c

+ 1
- 6
crypto/fipsmodule/bn/montgomery.c 파일 보기

@@ -316,15 +316,10 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r,
}

int max = (2 * n->top); // carry is stored separately
if (!bn_wexpand(r, max) ||
if (!bn_resize_words(r, max) ||
!bn_wexpand(ret, n->top)) {
return 0;
}
// Clear the top words of |r|.
if (max > r->top) {
OPENSSL_memset(r->d + r->top, 0, (max - r->top) * sizeof(BN_ULONG));
}
r->top = max;
ret->top = n->top;

if (!bn_from_montgomery_in_place(ret->d, ret->top, r->d, r->top, mont)) {


불러오는 중...
취소
저장