projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
PA-RISC assembler pack: switch to bve in 64-bit builds.
[oweals/openssl.git]
/
crypto
/
bn
/
bn_exp.c
diff --git
a/crypto/bn/bn_exp.c
b/crypto/bn/bn_exp.c
index a6730a4374709439b27305bf85f45a28823285ad..60f2d999325dc904647ef69e05842f40b02ab965 100644
(file)
--- a/
crypto/bn/bn_exp.c
+++ b/
crypto/bn/bn_exp.c
@@
-980,7
+980,14
@@
int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
bits = BN_num_bits(p);
if (bits == 0)
{
- ret = BN_one(rr);
+ /* x**0 mod 1 is still zero. */
+ if (BN_is_one(m))
+ {
+ ret = 1;
+ BN_zero(rr);
+ }
+ else
+ ret = BN_one(rr);
return ret;
}
if (a == 0)