summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_nist.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2003-11-05 19:30:29 +0000
committerGeoff Thorpe <geoff@openssl.org>2003-11-05 19:30:29 +0000
commit0ef85c7f4512570a02c4ff5d95a275ecf225702a (patch)
tree71f538a7a6df0a28d60d106348d7837e6ad8fa03 /crypto/bn/bn_nist.c
parent078dd1a0f94394632614123af3155866749ff79c (diff)
This is a revert of my previous commit to "improve" the declaration of
constant BIGNUMs. It turns out that this trips up different but equally useful compiler warnings to -Wcast-qual, and so wasn't worth the ugliness it created. (Thanks to Ulf for the forehead-slap.)
Diffstat (limited to 'crypto/bn/bn_nist.c')
-rw-r--r--crypto/bn/bn_nist.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/crypto/bn/bn_nist.c b/crypto/bn/bn_nist.c
index 79f7c2ef28..6aa196f6f8 100644
--- a/crypto/bn/bn_nist.c
+++ b/crypto/bn/bn_nist.c
@@ -127,40 +127,39 @@ const static BN_ULONG _nist_p_521[] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0x01};
#endif
-static const BIGNUM_C bn_nist_p_192 =
- { _nist_p_192, BN_NIST_192_TOP, BN_NIST_192_TOP, 0, BN_FLG_STATIC_DATA };
-static const BIGNUM_C bn_nist_p_224 =
- { _nist_p_224, BN_NIST_224_TOP, BN_NIST_224_TOP, 0, BN_FLG_STATIC_DATA };
-static const BIGNUM_C bn_nist_p_256 =
- { _nist_p_256, BN_NIST_256_TOP, BN_NIST_256_TOP, 0, BN_FLG_STATIC_DATA };
-static const BIGNUM_C bn_nist_p_384 =
- { _nist_p_384, BN_NIST_384_TOP, BN_NIST_384_TOP, 0, BN_FLG_STATIC_DATA };
-static const BIGNUM_C bn_nist_p_521 =
- { _nist_p_521, BN_NIST_521_TOP, BN_NIST_521_TOP, 0, BN_FLG_STATIC_DATA };
-
const BIGNUM *BN_get0_nist_prime_192(void)
{
- return BIGNUM_CONST(&bn_nist_p_192);
+ static BIGNUM const_nist_192 = { (BN_ULONG *)_nist_p_192,
+ BN_NIST_192_TOP, BN_NIST_192_TOP, 0, BN_FLG_STATIC_DATA };
+ return &const_nist_192;
}
const BIGNUM *BN_get0_nist_prime_224(void)
{
- return BIGNUM_CONST(&bn_nist_p_224);
+ static BIGNUM const_nist_224 = { (BN_ULONG *)_nist_p_224,
+ BN_NIST_224_TOP, BN_NIST_224_TOP, 0, BN_FLG_STATIC_DATA };
+ return &const_nist_224;
}
const BIGNUM *BN_get0_nist_prime_256(void)
{
- return BIGNUM_CONST(&bn_nist_p_256);
+ static BIGNUM const_nist_256 = { (BN_ULONG *)_nist_p_256,
+ BN_NIST_256_TOP, BN_NIST_256_TOP, 0, BN_FLG_STATIC_DATA };
+ return &const_nist_256;
}
const BIGNUM *BN_get0_nist_prime_384(void)
{
- return BIGNUM_CONST(&bn_nist_p_384);
+ static BIGNUM const_nist_384 = { (BN_ULONG *)_nist_p_384,
+ BN_NIST_384_TOP, BN_NIST_384_TOP, 0, BN_FLG_STATIC_DATA };
+ return &const_nist_384;
}
const BIGNUM *BN_get0_nist_prime_521(void)
{
- return BIGNUM_CONST(&bn_nist_p_521);
+ static BIGNUM const_nist_521 = { (BN_ULONG *)_nist_p_521,
+ BN_NIST_521_TOP, BN_NIST_521_TOP, 0, BN_FLG_STATIC_DATA };
+ return &const_nist_521;
}
/* some misc internal functions */