summaryrefslogtreecommitdiffstats
path: root/fips/rand/fips_rand_selftest.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-04-05 12:42:31 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-04-05 12:42:31 +0000
commitcab0595c1426b2f70d88b824028c6d1ef4a4476e (patch)
tree2030c0073ba4fb5f68eab1a378f7d7dcd667f6b4 /fips/rand/fips_rand_selftest.c
parent856650deb01bed257622d1ecb64db6d83cf5cdcc (diff)
Rename deprecated FIPS_rand functions to FIPS_x931. These shouldn't be
used by applications directly and the X9.31 PRNG is deprecated by new FIPS140-2 rules anyway.
Diffstat (limited to 'fips/rand/fips_rand_selftest.c')
-rw-r--r--fips/rand/fips_rand_selftest.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fips/rand/fips_rand_selftest.c b/fips/rand/fips_rand_selftest.c
index f352cc6cd7..ee5f320e0e 100644
--- a/fips/rand/fips_rand_selftest.c
+++ b/fips/rand/fips_rand_selftest.c
@@ -324,26 +324,26 @@ static AES_PRNG_TV aes_256_tv[] = {
};
-void FIPS_corrupt_rng()
+void FIPS_corrupt_x931()
{
aes_192_tv[0].V[0]++;
}
-#define fips_rand_test(key, tv) \
- do_rand_test(key, sizeof key, tv, sizeof(tv)/sizeof(AES_PRNG_TV))
+#define fips_x931_test(key, tv) \
+ do_x931_test(key, sizeof key, tv, sizeof(tv)/sizeof(AES_PRNG_TV))
-static int do_rand_test(unsigned char *key, int keylen,
+static int do_x931_test(unsigned char *key, int keylen,
AES_PRNG_TV *tv, int ntv)
{
unsigned char R[16];
int i;
- if (!FIPS_rand_set_key(key, keylen))
+ if (!FIPS_x931_set_key(key, keylen))
return 0;
for (i = 0; i < ntv; i++)
{
- FIPS_rand_seed(tv[i].V, 16);
- FIPS_rand_set_dt(tv[i].DT);
- FIPS_rand_bytes(R, 16);
+ FIPS_x931_seed(tv[i].V, 16);
+ FIPS_x931_set_dt(tv[i].DT);
+ FIPS_x931_bytes(R, 16);
if (memcmp(R, tv[i].R, 16))
return 0;
}
@@ -351,22 +351,22 @@ static int do_rand_test(unsigned char *key, int keylen,
}
-int FIPS_selftest_rng()
+int FIPS_selftest_x931()
{
- FIPS_rand_reset();
- if (!FIPS_rand_test_mode())
+ FIPS_x931_reset();
+ if (!FIPS_x931_test_mode())
{
FIPSerr(FIPS_F_FIPS_SELFTEST_RNG,FIPS_R_SELFTEST_FAILED);
return 0;
}
- if (!fips_rand_test(aes_128_key,aes_128_tv)
- || !fips_rand_test(aes_192_key, aes_192_tv)
- || !fips_rand_test(aes_256_key, aes_256_tv))
+ if (!fips_x931_test(aes_128_key,aes_128_tv)
+ || !fips_x931_test(aes_192_key, aes_192_tv)
+ || !fips_x931_test(aes_256_key, aes_256_tv))
{
FIPSerr(FIPS_F_FIPS_SELFTEST_RNG,FIPS_R_SELFTEST_FAILED);
return 0;
}
- FIPS_rand_reset();
+ FIPS_x931_reset();
return 1;
}