summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2011-09-14 20:48:49 +0000
committerAndy Polyakov <appro@openssl.org>2011-09-14 20:48:49 +0000
commit03e389cf049e4bbc2f6d0028dc320fb0583aad2c (patch)
tree61020185544c4ff9567d236e9c1ee3a74ee417c8
parent93256bf5d148f3b8fa02a410b4477c6c9ca20e65 (diff)
Allow for dynamic base in Win64 FIPS module.
-rw-r--r--crypto/aes/aes_core.c10
-rw-r--r--crypto/bn/bn_gf2m.c1
-rw-r--r--crypto/bn/bn_lib.c2
-rw-r--r--crypto/bn/bn_nist.c20
-rw-r--r--crypto/bn/bn_prime.h1
-rw-r--r--crypto/crypto.h4
-rw-r--r--crypto/des/fcrypt.c2
-rw-r--r--crypto/des/set_key.c4
-rw-r--r--crypto/des/spr.h1
-rw-r--r--crypto/dsa/dsa_gen.c1
-rw-r--r--crypto/ec/ec_curve.c60
-rw-r--r--crypto/ec/ec_lib.c1
-rw-r--r--crypto/modes/gcm128.c3
-rw-r--r--crypto/rsa/rsa_pss.c1
-rw-r--r--crypto/sha/sha1dgst.c1
-rw-r--r--crypto/sha/sha256.c2
-rw-r--r--crypto/sha/sha512.c2
-rw-r--r--crypto/thr_id.c1
-rw-r--r--fips/aes/fips_aes_selftest.c23
-rw-r--r--fips/cmac/fips_cmac_selftest.c1
-rw-r--r--fips/des/fips_des_selftest.c3
-rw-r--r--fips/dsa/fips_dsa_selftest.c5
-rw-r--r--fips/dsa/fips_dsatest.c2
-rw-r--r--fips/ecdsa/fips_ecdsa_selftest.c8
-rw-r--r--fips/fips.c1
-rw-r--r--fips/fips_canister.c8
-rw-r--r--fips/fips_post.c1
-rw-r--r--fips/fipssyms.h7
-rw-r--r--fips/hmac/fips_hmac_selftest.c3
-rw-r--r--fips/rand/fips_drbg_ec.c6
-rw-r--r--fips/rand/fips_drbg_selftest.h504
-rw-r--r--fips/rand/fips_randtest.c18
-rw-r--r--fips/rsa/fips_rsa_selftest.c10
-rw-r--r--fips/rsa/fips_rsa_sign.c20
-rw-r--r--fips/sha/fips_sha1_selftest.c1
-rw-r--r--util/pl/VC-32.pl2
36 files changed, 725 insertions, 15 deletions
diff --git a/crypto/aes/aes_core.c b/crypto/aes/aes_core.c
index ba90952829..f333c1651a 100644
--- a/crypto/aes/aes_core.c
+++ b/crypto/aes/aes_core.c
@@ -54,6 +54,7 @@ Td3[x] = Si[x].[09, 0d, 0b, 0e];
Td4[x] = Si[x].[01];
*/
+__fips_constseg
static const u32 Te0[256] = {
0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
@@ -120,6 +121,7 @@ static const u32 Te0[256] = {
0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,
};
+__fips_constseg
static const u32 Te1[256] = {
0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,
0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,
@@ -186,6 +188,7 @@ static const u32 Te1[256] = {
0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,
0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U,
};
+__fips_constseg
static const u32 Te2[256] = {
0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,
0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,
@@ -252,6 +255,7 @@ static const u32 Te2[256] = {
0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,
0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,
};
+__fips_constseg
static const u32 Te3[256] = {
0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
@@ -319,6 +323,7 @@ static const u32 Te3[256] = {
0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
};
+__fips_constseg
static const u32 Td0[256] = {
0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
@@ -385,6 +390,7 @@ static const u32 Td0[256] = {
0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,
};
+__fips_constseg
static const u32 Td1[256] = {
0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,
0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,
@@ -451,6 +457,7 @@ static const u32 Td1[256] = {
0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,
0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U,
};
+__fips_constseg
static const u32 Td2[256] = {
0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,
0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,
@@ -517,6 +524,7 @@ static const u32 Td2[256] = {
0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,
0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U,
};
+__fips_constseg
static const u32 Td3[256] = {
0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,
0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,
@@ -583,6 +591,7 @@ static const u32 Td3[256] = {
0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
};
+__fips_constseg
static const u8 Td4[256] = {
0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U,
0xbfU, 0x40U, 0xa3U, 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU,
@@ -617,6 +626,7 @@ static const u8 Td4[256] = {
0x17U, 0x2bU, 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U,
0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, 0x21U, 0x0cU, 0x7dU,
};
+__fips_constseg
static const u32 rcon[] = {
0x01000000, 0x02000000, 0x04000000, 0x08000000,
0x10000000, 0x20000000, 0x40000000, 0x80000000,
diff --git a/crypto/bn/bn_gf2m.c b/crypto/bn/bn_gf2m.c
index 7189ae5d82..70770a2536 100644
--- a/crypto/bn/bn_gf2m.c
+++ b/crypto/bn/bn_gf2m.c
@@ -101,6 +101,7 @@
/* Maximum number of iterations before BN_GF2m_mod_solve_quad_arr should fail. */
#define MAX_ITERATIONS 50
+__fips_constseg
static const BN_ULONG SQR_tb[16] =
{ 0, 1, 4, 5, 16, 17, 20, 21,
64, 65, 68, 69, 80, 81, 84, 85 };
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c
index e7dea71911..f77fdb75fd 100644
--- a/crypto/bn/bn_lib.c
+++ b/crypto/bn/bn_lib.c
@@ -69,6 +69,7 @@
#include "cryptlib.h"
#include "bn_lcl.h"
+__fips_constseg
const char BN_version[]="Big Number" OPENSSL_VERSION_PTEXT;
/* This stuff appears to be completely unused, so is deprecated */
@@ -143,6 +144,7 @@ const BIGNUM *BN_value_one(void)
int BN_num_bits_word(BN_ULONG l)
{
+ __fips_constseg
static const unsigned char bits[256]={
0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
diff --git a/crypto/bn/bn_nist.c b/crypto/bn/bn_nist.c
index 7cdf31c2f6..86bb0429f3 100644
--- a/crypto/bn/bn_nist.c
+++ b/crypto/bn/bn_nist.c
@@ -68,27 +68,32 @@
/* pre-computed tables are "carry-less" values of modulus*(i+1) */
#if BN_BITS2 == 64
+__fips_constseg
static const BN_ULONG _nist_p_192[][BN_NIST_192_TOP] = {
{0xFFFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFEULL,0xFFFFFFFFFFFFFFFFULL},
{0xFFFFFFFFFFFFFFFEULL,0xFFFFFFFFFFFFFFFDULL,0xFFFFFFFFFFFFFFFFULL},
{0xFFFFFFFFFFFFFFFDULL,0xFFFFFFFFFFFFFFFCULL,0xFFFFFFFFFFFFFFFFULL}
};
+__fips_constseg
static const BN_ULONG _nist_p_192_sqr[] = {
0x0000000000000001ULL,0x0000000000000002ULL,0x0000000000000001ULL,
0xFFFFFFFFFFFFFFFEULL,0xFFFFFFFFFFFFFFFDULL,0xFFFFFFFFFFFFFFFFULL
};
+__fips_constseg
static const BN_ULONG _nist_p_224[][BN_NIST_224_TOP] = {
{0x0000000000000001ULL,0xFFFFFFFF00000000ULL,
0xFFFFFFFFFFFFFFFFULL,0x00000000FFFFFFFFULL},
{0x0000000000000002ULL,0xFFFFFFFE00000000ULL,
0xFFFFFFFFFFFFFFFFULL,0x00000001FFFFFFFFULL} /* this one is "carry-full" */
};
+__fips_constseg
static const BN_ULONG _nist_p_224_sqr[] = {
0x0000000000000001ULL,0xFFFFFFFE00000000ULL,
0xFFFFFFFFFFFFFFFFULL,0x0000000200000000ULL,
0x0000000000000000ULL,0xFFFFFFFFFFFFFFFEULL,
0xFFFFFFFFFFFFFFFFULL
};
+__fips_constseg
static const BN_ULONG _nist_p_256[][BN_NIST_256_TOP] = {
{0xFFFFFFFFFFFFFFFFULL,0x00000000FFFFFFFFULL,
0x0000000000000000ULL,0xFFFFFFFF00000001ULL},
@@ -101,12 +106,14 @@ static const BN_ULONG _nist_p_256[][BN_NIST_256_TOP] = {
{0xFFFFFFFFFFFFFFFBULL,0x00000004FFFFFFFFULL,
0x0000000000000000ULL,0xFFFFFFFB00000005ULL},
};
+__fips_constseg
static const BN_ULONG _nist_p_256_sqr[] = {
0x0000000000000001ULL,0xFFFFFFFE00000000ULL,
0xFFFFFFFFFFFFFFFFULL,0x00000001FFFFFFFEULL,
0x00000001FFFFFFFEULL,0x00000001FFFFFFFEULL,
0xFFFFFFFE00000001ULL,0xFFFFFFFE00000002ULL
};
+__fips_constseg
static const BN_ULONG _nist_p_384[][BN_NIST_384_TOP] = {
{0x00000000FFFFFFFFULL,0xFFFFFFFF00000000ULL,0xFFFFFFFFFFFFFFFEULL,
0xFFFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFFULL},
@@ -119,18 +126,21 @@ static const BN_ULONG _nist_p_384[][BN_NIST_384_TOP] = {
{0x00000004FFFFFFFBULL,0xFFFFFFFB00000000ULL,0xFFFFFFFFFFFFFFFAULL,
0xFFFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFFULL},
};
+__fips_constseg
static const BN_ULONG _nist_p_384_sqr[] = {
0xFFFFFFFE00000001ULL,0x0000000200000000ULL,0xFFFFFFFE00000000ULL,
0x0000000200000000ULL,0x0000000000000001ULL,0x0000000000000000ULL,
0x00000001FFFFFFFEULL,0xFFFFFFFE00000000ULL,0xFFFFFFFFFFFFFFFDULL,
0xFFFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFFULL
};
+__fips_constseg
static const BN_ULONG _nist_p_521[] =
{0xFFFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL,0xFFFFFFFFFFFFFFFFULL,
0x00000000000001FFULL};
+__fips_constseg
static const BN_ULONG _nist_p_521_sqr[] = {
0x0000000000000001ULL,0x0000000000000000ULL,0x0000000000000000ULL,
0x0000000000000000ULL,0x0000000000000000ULL,0x0000000000000000ULL,
@@ -140,27 +150,32 @@ static const BN_ULONG _nist_p_521_sqr[] = {
0xFFFFFFFFFFFFFFFFULL,0x000000000003FFFFULL
};
#elif BN_BITS2 == 32
+__fips_constseg
static const BN_ULONG _nist_p_192[][BN_NIST_192_TOP] = {
{0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFE,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF},
{0xFFFFFFFE,0xFFFFFFFF,0xFFFFFFFD,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF},
{0xFFFFFFFD,0xFFFFFFFF,0xFFFFFFFC,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF}
};
+__fips_constseg
static const BN_ULONG _nist_p_192_sqr[] = {
0x00000001,0x00000000,0x00000002,0x00000000,0x00000001,0x00000000,
0xFFFFFFFE,0xFFFFFFFF,0xFFFFFFFD,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF
};
+__fips_constseg
static const BN_ULONG _nist_p_224[][BN_NIST_224_TOP] = {
{0x00000001,0x00000000,0x00000000,0xFFFFFFFF,
0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF},
{0x00000002,0x00000000,0x00000000,0xFFFFFFFE,
0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF}
};
+__fips_constseg
static const BN_ULONG _nist_p_224_sqr[] = {
0x00000001,0x00000000,0x00000000,0xFFFFFFFE,
0xFFFFFFFF,0xFFFFFFFF,0x00000000,0x00000002,
0x00000000,0x00000000,0xFFFFFFFE,0xFFFFFFFF,
0xFFFFFFFF,0xFFFFFFFF
};
+__fips_constseg
static const BN_ULONG _nist_p_256[][BN_NIST_256_TOP] = {
{0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0x00000000,
0x00000000,0x00000000,0x00000001,0xFFFFFFFF},
@@ -173,12 +188,14 @@ static const BN_ULONG _nist_p_256[][BN_NIST_256_TOP] = {
{0xFFFFFFFB,0xFFFFFFFF,0xFFFFFFFF,0x00000004,
0x00000000,0x00000000,0x00000005,0xFFFFFFFB},
};
+__fips_constseg
static const BN_ULONG _nist_p_256_sqr[] = {
0x00000001,0x00000000,0x00000000,0xFFFFFFFE,
0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFE,0x00000001,
0xFFFFFFFE,0x00000001,0xFFFFFFFE,0x00000001,
0x00000001,0xFFFFFFFE,0x00000002,0xFFFFFFFE
};
+__fips_constseg
static const BN_ULONG _nist_p_384[][BN_NIST_384_TOP] = {
{0xFFFFFFFF,0x00000000,0x00000000,0xFFFFFFFF,0xFFFFFFFE,0xFFFFFFFF,
0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF},
@@ -191,16 +208,19 @@ static const BN_ULONG _nist_p_384[][BN_NIST_384_TOP] = {
{0xFFFFFFFB,0x00000004,0x00000000,0xFFFFFFFB,0xFFFFFFFA,0xFFFFFFFF,
0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF},
};
+__fips_constseg
static const BN_ULONG _nist_p_384_sqr[] = {
0x00000001,0xFFFFFFFE,0x00000000,0x00000002,0x00000000,0xFFFFFFFE,
0x00000000,0x00000002,0x00000001,0x00000000,0x00000000,0x00000000,
0xFFFFFFFE,0x00000001,0x00000000,0xFFFFFFFE,0xFFFFFFFD,0xFFFFFFFF,
0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF
};
+__fips_constseg
static const BN_ULONG _nist_p_521[] = {0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
0xFFFFFFFF,0x000001FF};
+__fips_constseg
static const BN_ULONG _nist_p_521_sqr[] = {
0x00000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
diff --git a/crypto/bn/bn_prime.h b/crypto/bn/bn_prime.h
index 51d2194feb..bd04602e4f 100644
--- a/crypto/bn/bn_prime.h
+++ b/crypto/bn/bn_prime.h
@@ -63,6 +63,7 @@ typedef unsigned short prime_t;
#define NUMPRIMES 54
typedef unsigned char prime_t;
#endif
+__fips_constseg
static const prime_t primes[NUMPRIMES]=
{
2, 3, 5, 7, 11, 13, 17, 19,
diff --git a/crypto/crypto.h b/crypto/crypto.h
index 34c2d75808..040a989b23 100644
--- a/crypto/crypto.h
+++ b/crypto/crypto.h
@@ -148,7 +148,9 @@
*/
#if defined(OPENSSL_FIPSCANISTER)
-#include <openssl/fipssyms.h>
+# include <openssl/fipssyms.h>
+#else
+# define __fips_constseg
#endif
#ifdef __cplusplus
diff --git a/crypto/des/fcrypt.c b/crypto/des/fcrypt.c
index 04f95fa5b0..91811168c6 100644
--- a/crypto/des/fcrypt.c
+++ b/crypto/des/fcrypt.c
@@ -30,6 +30,7 @@
* crypt() implementations do. The patch was sent by
* Bjorn Gronvall <bg@sics.se>
*/
+__fips_constseg
static unsigned const char con_salt[128]={
0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,
0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,0xE0,0xE1,
@@ -49,6 +50,7 @@ static unsigned const char con_salt[128]={
0x3D,0x3E,0x3F,0x40,0x41,0x42,0x43,0x44,
};
+__fips_constseg
static unsigned const char cov_2char[64]={
0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,
0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44,
diff --git a/crypto/des/set_key.c b/crypto/des/set_key.c
index ce4faf2322..25e82ead2a 100644
--- a/crypto/des/set_key.c
+++ b/crypto/des/set_key.c
@@ -68,6 +68,7 @@
OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key,0) /* defaults to false */
+__fips_constseg
static const unsigned char odd_parity[256]={
1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14,
16, 16, 19, 19, 21, 21, 22, 22, 25, 25, 26, 26, 28, 28, 31, 31,
@@ -116,6 +117,7 @@ int DES_check_key_parity(const_DES_cblock *key)
* (and actual cblock values).
*/
#define NUM_WEAK_KEY 16
+__fips_constseg
static const DES_cblock weak_keys[NUM_WEAK_KEY]={
/* weak keys */
{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},
@@ -161,6 +163,7 @@ int DES_is_weak_key(const_DES_cblock *key)
#define HPERM_OP(a,t,n,m) ((t)=((((a)<<(16-(n)))^(a))&(m)),\
(a)=(a)^(t)^(t>>(16-(n))))
+__fips_constseg
static const DES_LONG des_skb[8][64]={
{
/* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
@@ -337,6 +340,7 @@ int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule)
void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule)
{
+ __fips_constseg
static const int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0};
register DES_LONG c,d,t,s,t2;
register const unsigned char *in;
diff --git a/crypto/des/spr.h b/crypto/des/spr.h
index b91936a5a5..9be0dce9f6 100644
--- a/crypto/des/spr.h
+++ b/crypto/des/spr.h
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+__fips_constseg
OPENSSL_GLOBAL const DES_LONG DES_SPtrans[8][64]={
{
/* nibble 0 */
diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c
index e88b3fcf7c..c013a7e660 100644
--- a/crypto/dsa/dsa_gen.c
+++ b/crypto/dsa/dsa_gen.c
@@ -691,6 +691,7 @@ end:
for (;;)
{
+ __fips_constseg
static const unsigned char ggen[4] = {0x67,0x67,0x65,0x6e};
if (idx >= 0)
{
diff --git a/crypto/ec/ec_curve.c b/crypto/ec/ec_curve.c
index 7d56dfcf4e..a51a545500 100644
--- a/crypto/ec/ec_curve.c
+++ b/crypto/ec/ec_curve.c
@@ -84,6 +84,7 @@ typedef struct {
} EC_CURVE_DATA;
/* the nist prime curves */
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+24*6]; }
_EC_NIST_PRIME_192 = {
{ NID_X9_62_prime_field,20,24,1 },
@@ -110,6 +111,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+24*6]; }
0xB4,0xD2,0x28,0x31 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+28*6]; }
_EC_NIST_PRIME_224 = {
{ NID_X9_62_prime_field,20,28,1 },
@@ -136,6 +138,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+28*6]; }
0x13,0xDD,0x29,0x45,0x5C,0x5C,0x2A,0x3D }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+48*6]; }
_EC_NIST_PRIME_384 = {
{ NID_X9_62_prime_field,20,48,1 },
@@ -174,6 +177,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+48*6]; }
0xEC,0xEC,0x19,0x6A,0xCC,0xC5,0x29,0x73 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+66*6]; }
_EC_NIST_PRIME_521 = {
{ NID_X9_62_prime_field,20,66,1 },
@@ -225,6 +229,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+66*6]; }
};
/* the x9.62 prime curves (minus the nist prime curves) */
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+24*6]; }
_EC_X9_62_PRIME_192V2 = {
{ NID_X9_62_prime_field,20,24,1 },
@@ -251,6 +256,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+24*6]; }
0x48,0xD8,0xDD,0x31 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+24*6]; }
_EC_X9_62_PRIME_192V3 = {
{ NID_X9_62_prime_field,20,24,1 },
@@ -277,6 +283,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+24*6]; }
0xF6,0x40,0xEC,0x13 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+30*6]; }
_EC_X9_62_PRIME_239V1 = {
{ NID_X9_62_prime_field,20,30,1 },
@@ -308,6 +315,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+30*6]; }
0x90,0x71,0xFB,0xD1,0x52,0x26,0x88,0x90,0x9D,0x0B }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+30*6]; }
_EC_X9_62_PRIME_239V2 = {
{ NID_X9_62_prime_field,20,30,1 },
@@ -339,6 +347,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+30*6]; }
0x77,0xD4,0x14,0xC0,0x38,0x21,0xBC,0x58,0x20,0x63 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+30*6]; }
_EC_X9_62_PRIME_239V3 = {
{ NID_X9_62_prime_field,20,30,1 },
@@ -371,6 +380,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+30*6]; }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+32*6]; }
_EC_X9_62_PRIME_256V1 = {
{ NID_X9_62_prime_field,20,32,1 },
@@ -404,6 +414,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+32*6]; }
};
/* the secg prime curves (minus the nist and x9.62 prime curves) */
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+14*6]; }
_EC_SECG_PRIME_112R1 = {
{ NID_X9_62_prime_field,20,14,1 },
@@ -424,6 +435,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+14*6]; }
0xAC,0x65,0x61,0xC5 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+14*6]; }
_EC_SECG_PRIME_112R2 = {
{ NID_X9_62_prime_field,20,14,4 },
@@ -444,6 +456,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+14*6]; }
0x05,0x20,0xD0,0x4B }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+16*6]; }
_EC_SECG_PRIME_128R1 = {
{ NID_X9_62_prime_field,20,16,1 },
@@ -464,6 +477,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+16*6]; }
0x0D,0x1B,0x90,0x38,0xA1,0x15 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+16*6]; }
_EC_SECG_PRIME_128R2 = {
{ NID_X9_62_prime_field,20,16,4 },
@@ -484,6 +498,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+16*6]; }
0x24,0x72,0x06,0x13,0xB5,0xA3 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+21*6]; }
_EC_SECG_PRIME_160K1 = {
{ NID_X9_62_prime_field,0,21,1 },
@@ -508,6 +523,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+21*6]; }
0xB3 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+21*6]; }
_EC_SECG_PRIME_160R1 = {
{ NID_X9_62_prime_field,20,21,1 },
@@ -534,6 +550,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+21*6]; }
0x57 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+21*6]; }
_EC_SECG_PRIME_160R2 = {
{ NID_X9_62_prime_field,20,21,1 },
@@ -560,6 +577,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+21*6]; }
0x6B }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+24*6]; }
_EC_SECG_PRIME_192K1 = {
{ NID_X9_62_prime_field,0,24,1 },
@@ -584,6 +602,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+24*6]; }
0x74,0xDE,0xFD,0x8D }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+29*6]; }
_EC_SECG_PRIME_224K1 = {
{ NID_X9_62_prime_field,0,29,1 },
@@ -608,6 +627,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+29*6]; }
0x84,0xCA,0xF0,0xA9,0x71,0x76,0x9F,0xB1,0xF7 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+32*6]; }
_EC_SECG_PRIME_256K1 = {
{ NID_X9_62_prime_field,0,32,1 },
@@ -639,6 +659,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+32*6]; }
};
/* some wap/wtls curves */
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+15*6]; }
_EC_WTLS_8 = {
{ NID_X9_62_prime_field,0,15,1 },
@@ -657,6 +678,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+15*6]; }
0x55,0x1A,0xD8,0x37,0xE9 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+21*6]; }
_EC_WTLS_9 = {
{ NID_X9_62_prime_field,0,21,1 },
@@ -681,6 +703,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+21*6]; }
0x33 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+28*6]; }
_EC_WTLS_12 = {
{ NID_X9_62_prime_field,0,28,1 },
@@ -708,6 +731,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+28*6]; }
#ifndef OPENSSL_NO_EC2M
/* characteristic two curves */
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+15*6]; }
_EC_SECG_CHAR2_113R1 = {
{ NID_X9_62_characteristic_two_field,20,15,2 },
@@ -728,6 +752,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+15*6]; }
0xEC,0x8A,0x39,0xE5,0x6F }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+15*6]; }
_EC_SECG_CHAR2_113R2 = {
{ NID_X9_62_characteristic_two_field,20,15,2 },
@@ -748,6 +773,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+15*6]; }
0x9B,0x24,0x96,0xAF,0x93 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+17*6]; }
_EC_SECG_CHAR2_131R1 = {
{ NID_X9_62_characteristic_two_field,20,17,2 },
@@ -768,6 +794,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+17*6]; }
0x23,0x95,0x3A,0x94,0x64,0xB5,0x4D }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+17*6]; }
_EC_SECG_CHAR2_131R2 = {
{ NID_X9_62_characteristic_two_field,20,17,2 },
@@ -788,6 +815,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+17*6]; }
0x54,0xA2,0x33,0x04,0x9B,0xA9,0x8F }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+21*6]; }
_EC_NIST_CHAR2_163K = {
{ NID_X9_62_characteristic_two_field,0,21,2 },
@@ -812,6 +840,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+21*6]; }
0xEF }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+21*6]; }
_EC_SECG_CHAR2_163R1 = {
{ NID_X9_62_characteristic_two_field,0,21,2 },
@@ -843,6 +872,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+21*6]; }
0x9B }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+21*6]; }
_EC_NIST_CHAR2_163B = {
{ NID_X9_62_characteristic_two_field,0,21,2 },
@@ -873,6 +903,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+21*6]; }
0x33 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+25*6]; }
_EC_SECG_CHAR2_193R1 = {
{ NID_X9_62_characteristic_two_field,20,25,2 },
@@ -899,6 +930,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+25*6]; }
0xCC,0x92,0x0E,0xBA,0x49 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+25*6]; }
_EC_SECG_CHAR2_193R2 = {
{ NID_X9_62_characteristic_two_field,20,25,2 },
@@ -925,6 +957,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+25*6]; }
0xCC,0xD4,0xEE,0x99,0xD5 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+30*6]; }
_EC_NIST_CHAR2_233K = {
{ NID_X9_62_characteristic_two_field,0,30,4 },
@@ -954,6 +987,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+30*6]; }
0xBC,0xD4,0x6E,0xFB,0x1A,0xD5,0xF1,0x73,0xAB,0xDF }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+30*6]; }
_EC_NIST_CHAR2_233B = {
{ NID_X9_62_characteristic_two_field,20,30,2 },
@@ -985,6 +1019,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+30*6]; }
0x8A,0x69,0x22,0x03,0x1D,0x26,0x03,0xCF,0xE0,0xD7 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+30*6]; }
_EC_SECG_CHAR2_239K1 = {
{ NID_X9_62_characteristic_two_field,0,30,4 },
@@ -1014,6 +1049,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+30*6]; }
0xB6,0xE9,0x1F,0x1C,0x1D,0xA8,0x00,0xE4,0x78,0xA5 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+36*6]; }
_EC_NIST_CHAR2_283K = {
{ NID_X9_62_characteristic_two_field,0,36,4 },
@@ -1044,6 +1080,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+36*6]; }
0x1E,0x06,0x1E,0x16,0x3C,0x61 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+36*6]; }
_EC_NIST_CHAR2_283B = {
{ NID_X9_62_characteristic_two_field,20,36,2 },
@@ -1076,6 +1113,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+36*6]; }
0x2A,0x7C,0xEF,0xAD,0xB3,0x07 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+52*6]; }
_EC_NIST_CHAR2_409K = {
{ NID_X9_62_characteristic_two_field,0,52,4 },
@@ -1118,6 +1156,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+52*6]; }
0x5F,0xCF }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+52*6]; }
_EC_NIST_CHAR2_409B = {
{ NID_X9_62_characteristic_two_field,20,52,2 },
@@ -1162,6 +1201,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+52*6]; }
0x11,0x73 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+72*6]; }
_EC_NIST_CHAR2_571K = {
{ NID_X9_62_characteristic_two_field,0,72,4 },
@@ -1216,6 +1256,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[0+72*6]; }
0x10,0x01 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+72*6]; }
_EC_NIST_CHAR2_571B = {
{ NID_X9_62_characteristic_two_field,20,72,2 },
@@ -1272,6 +1313,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+72*6]; }
0x4E,0x47 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+21*6]; }
_EC_X9_62_CHAR2_163V1 = {
{ NID_X9_62_characteristic_two_field,20,21,2 },
@@ -1298,6 +1340,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+21*6]; }
0xC1 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+21*6]; }
_EC_X9_62_CHAR2_163V2 = {
{ NID_X9_62_characteristic_two_field,20,21,2 },
@@ -1324,6 +1367,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+21*6]; }
0xA7 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[20+21*6]; }
_EC_X9_62_CHAR2_163V3 = {
{ NID_X9_62_characteristic_two_field,20,21,2 },
@@ -1350,6 +1394,7 @@ static const struct { EC_CURVE_DATA h; unsigned char data[20+21*6]; }
0x09 }
};
+__fips_constseg
static const struct { EC_CURVE_DATA h; unsigned char data[0+23*6]; }