summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_prime.h
diff options
context:
space:
mode:
authormiod <>2014-04-24 21:31:02 +0000
committermiod <>2014-04-24 21:31:02 +0000
commit7e3ee009cb00e65ea487ba61ae3b5271c73c19d6 (patch)
treee53472b5e8d9eec9f62ca322e053d1c8f66dc1cc /src/lib/libcrypto/bn/bn_prime.h
parent04cb67d517205b357d70ac65a314fea6e6a1a479 (diff)
downloadopenbsd-7e3ee009cb00e65ea487ba61ae3b5271c73c19d6.tar.gz
openbsd-7e3ee009cb00e65ea487ba61ae3b5271c73c19d6.tar.bz2
openbsd-7e3ee009cb00e65ea487ba61ae3b5271c73c19d6.zip
Try to clean the maze of <openssl/bn.h> defines regarding the BN internals.
The intent of this change is to only keep support for two kind of architectures: - those with 32-bit int and long, and 64-bit long long, where ``long * long -> long long'' multiplication routines are available. - those with 64-bit int and long, and no 128-bit long long type. This gets rid of the SIXTY_FOUR_BIT_LONG, SIXTY_FOUR_BIT (not the same!), THIRTY_TWO_BIT, SIXTEEN_BIT and EIGHT_BIT defines. After this change, the types and defines are as follows: arch: 64bit 32bit rationale BN_LLONG undefined defined defined if l * l -> ll BN_ULLONG undefined u long long result of BN_LONG * BN_LONG BN_ULONG u long u int native register size BN_LONG long int the same, signed BN_BITS 128 64 size of 2*BN_ULONG in bits BN_BYTES 8 4 size of 2*BN_ULONG in bytes BN_BITS2 64 32 BN_BITS / 2 Tested on various 32-bit and 64-bit OpenBSD systems of various endianness.
Diffstat (limited to 'src/lib/libcrypto/bn/bn_prime.h')
-rw-r--r--src/lib/libcrypto/bn/bn_prime.h10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/lib/libcrypto/bn/bn_prime.h b/src/lib/libcrypto/bn/bn_prime.h
index 51d2194feb..ccdeca5afa 100644
--- a/src/lib/libcrypto/bn/bn_prime.h
+++ b/src/lib/libcrypto/bn/bn_prime.h
@@ -56,13 +56,8 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#ifndef EIGHT_BIT
60#define NUMPRIMES 2048 59#define NUMPRIMES 2048
61typedef unsigned short prime_t; 60typedef unsigned short prime_t;
62#else
63#define NUMPRIMES 54
64typedef unsigned char prime_t;
65#endif
66static const prime_t primes[NUMPRIMES]= 61static const prime_t primes[NUMPRIMES]=
67 { 62 {
68 2, 3, 5, 7, 11, 13, 17, 19, 63 2, 3, 5, 7, 11, 13, 17, 19,
@@ -71,9 +66,7 @@ static const prime_t primes[NUMPRIMES]=
71 97, 101, 103, 107, 109, 113, 127, 131, 66 97, 101, 103, 107, 109, 113, 127, 131,
72 137, 139, 149, 151, 157, 163, 167, 173, 67 137, 139, 149, 151, 157, 163, 167, 173,
73 179, 181, 191, 193, 197, 199, 211, 223, 68 179, 181, 191, 193, 197, 199, 211, 223,
74 227, 229, 233, 239, 241, 251, 69 227, 229, 233, 239, 241, 251, 257, 263,
75#ifndef EIGHT_BIT
76 257, 263,
77 269, 271, 277, 281, 283, 293, 307, 311, 70 269, 271, 277, 281, 283, 293, 307, 311,
78 313, 317, 331, 337, 347, 349, 353, 359, 71 313, 317, 331, 337, 347, 349, 353, 359,
79 367, 373, 379, 383, 389, 397, 401, 409, 72 367, 373, 379, 383, 389, 397, 401, 409,
@@ -323,5 +316,4 @@ static const prime_t primes[NUMPRIMES]=
323 17609,17623,17627,17657,17659,17669,17681,17683, 316 17609,17623,17627,17657,17659,17669,17681,17683,
324 17707,17713,17729,17737,17747,17749,17761,17783, 317 17707,17713,17729,17737,17747,17749,17761,17783,
325 17789,17791,17807,17827,17837,17839,17851,17863, 318 17789,17791,17807,17827,17837,17839,17851,17863,
326#endif
327 }; 319 };