summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sha/sha256.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/sha/sha256.c')
-rw-r--r--src/lib/libcrypto/sha/sha256.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/libcrypto/sha/sha256.c b/src/lib/libcrypto/sha/sha256.c
index 867f90cc97..3256a83e98 100644
--- a/src/lib/libcrypto/sha/sha256.c
+++ b/src/lib/libcrypto/sha/sha256.c
@@ -12,12 +12,19 @@
12 12
13#include <openssl/crypto.h> 13#include <openssl/crypto.h>
14#include <openssl/sha.h> 14#include <openssl/sha.h>
15#ifdef OPENSSL_FIPS
16#include <openssl/fips.h>
17#endif
18
15#include <openssl/opensslv.h> 19#include <openssl/opensslv.h>
16 20
17const char SHA256_version[]="SHA-256" OPENSSL_VERSION_PTEXT; 21const char SHA256_version[]="SHA-256" OPENSSL_VERSION_PTEXT;
18 22
19int SHA224_Init (SHA256_CTX *c) 23int SHA224_Init (SHA256_CTX *c)
20 { 24 {
25#ifdef OPENSSL_FIPS
26 FIPS_selftest_check();
27#endif
21 c->h[0]=0xc1059ed8UL; c->h[1]=0x367cd507UL; 28 c->h[0]=0xc1059ed8UL; c->h[1]=0x367cd507UL;
22 c->h[2]=0x3070dd17UL; c->h[3]=0xf70e5939UL; 29 c->h[2]=0x3070dd17UL; c->h[3]=0xf70e5939UL;
23 c->h[4]=0xffc00b31UL; c->h[5]=0x68581511UL; 30 c->h[4]=0xffc00b31UL; c->h[5]=0x68581511UL;
@@ -29,6 +36,9 @@ int SHA224_Init (SHA256_CTX *c)
29 36
30int SHA256_Init (SHA256_CTX *c) 37int SHA256_Init (SHA256_CTX *c)
31 { 38 {
39#ifdef OPENSSL_FIPS
40 FIPS_selftest_check();
41#endif
32 c->h[0]=0x6a09e667UL; c->h[1]=0xbb67ae85UL; 42 c->h[0]=0x6a09e667UL; c->h[1]=0xbb67ae85UL;
33 c->h[2]=0x3c6ef372UL; c->h[3]=0xa54ff53aUL; 43 c->h[2]=0x3c6ef372UL; c->h[3]=0xa54ff53aUL;
34 c->h[4]=0x510e527fUL; c->h[5]=0x9b05688cUL; 44 c->h[4]=0x510e527fUL; c->h[5]=0x9b05688cUL;