summaryrefslogtreecommitdiffstats
path: root/crypto/des
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 /crypto/des
parent93256bf5d148f3b8fa02a410b4477c6c9ca20e65 (diff)
Allow for dynamic base in Win64 FIPS module.
Diffstat (limited to 'crypto/des')
-rw-r--r--crypto/des/fcrypt.c2
-rw-r--r--crypto/des/set_key.c4
-rw-r--r--crypto/des/spr.h1
3 files changed, 7 insertions, 0 deletions
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 */