瀏覽代碼

Remove a = 0 special-case in BN_mod_exp_mont.

BN_mod_exp_mont is intended to protect the base, but not the exponent.
Accordingly, it shouldn't treat a base of zero as special.

Change-Id: Ib053e8ce65ab1741973a9f9bfeff8c353567439c
Reviewed-on: https://boringssl-review.googlesource.com/27284
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 6 年之前
committed by Adam Langley
父節點
當前提交
e0ae249f03
共有 1 個檔案被更改,包括 0 行新增6 行删除
  1. +0
    -6
      crypto/fipsmodule/bn/exponentiation.c

+ 0
- 6
crypto/fipsmodule/bn/exponentiation.c 查看文件

@@ -639,12 +639,6 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
aa = a;
}

if (BN_is_zero(aa)) {
BN_zero(rr);
ret = 1;
goto err;
}

// We exponentiate by looking at sliding windows of the exponent and
// precomputing powers of |aa|. Windows may be shifted so they always end on a
// set bit, so only precompute odd powers. We compute val[i] = aa^(2*i + 1)


Loading…
取消
儲存