bn_exp.c (269682) | bn_exp.c (273144) |
---|---|
1/* crypto/bn/bn_exp.c */ 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 * All rights reserved. 4 * 5 * This package is an SSL implementation written 6 * by Eric Young (eay@cryptsoft.com). 7 * The implementation was written so as to conform with Netscapes SSL. 8 * --- 860 unchanged lines hidden (view full) --- 869 return(0); 870 } 871 if (m->top == 1) 872 a %= m->d[0]; /* make sure that 'a' is reduced */ 873 874 bits = BN_num_bits(p); 875 if (bits == 0) 876 { | 1/* crypto/bn/bn_exp.c */ 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 * All rights reserved. 4 * 5 * This package is an SSL implementation written 6 * by Eric Young (eay@cryptsoft.com). 7 * The implementation was written so as to conform with Netscapes SSL. 8 * --- 860 unchanged lines hidden (view full) --- 869 return(0); 870 } 871 if (m->top == 1) 872 a %= m->d[0]; /* make sure that 'a' is reduced */ 873 874 bits = BN_num_bits(p); 875 if (bits == 0) 876 { |
877 ret = BN_one(rr); | 877 /* x**0 mod 1 is still zero. */ 878 if (BN_is_one(m)) 879 { 880 ret = 1; 881 BN_zero(rr); 882 } 883 else 884 ret = BN_one(rr); |
878 return ret; 879 } 880 if (a == 0) 881 { 882 BN_zero(rr); 883 ret = 1; 884 return ret; 885 } --- 212 unchanged lines hidden --- | 885 return ret; 886 } 887 if (a == 0) 888 { 889 BN_zero(rr); 890 ret = 1; 891 return ret; 892 } --- 212 unchanged lines hidden --- |