23 #ifndef WOLF_CRYPT_SHA3_H 24 #define WOLF_CRYPT_SHA3_H 32 #include <wolfssl/wolfcrypt/fips.h> 39 #ifdef WOLFSSL_ASYNC_CRYPT 40 #include <wolfssl/wolfcrypt/async.h> 45 WC_SHA3_224 = WC_HASH_TYPE_SHA3_224,
46 WC_SHA3_224_DIGEST_SIZE = 28,
47 WC_SHA3_224_COUNT = 18,
49 WC_SHA3_256 = WC_HASH_TYPE_SHA3_256,
50 WC_SHA3_256_DIGEST_SIZE = 32,
51 WC_SHA3_256_COUNT = 17,
53 WC_SHA3_384 = WC_HASH_TYPE_SHA3_384,
54 WC_SHA3_384_DIGEST_SIZE = 48,
55 WC_SHA3_384_COUNT = 13,
57 WC_SHA3_512 = WC_HASH_TYPE_SHA3_512,
58 WC_SHA3_512_DIGEST_SIZE = 64,
59 WC_SHA3_512_COUNT = 9,
64 WC_SHA3_224_BLOCK_SIZE = 144,
65 WC_SHA3_256_BLOCK_SIZE = 136,
66 WC_SHA3_384_BLOCK_SIZE = 104,
67 WC_SHA3_512_BLOCK_SIZE = 72,
71 #ifndef NO_OLD_WC_NAMES 72 #define SHA3_224 WC_SHA3_224 73 #define SHA3_224_DIGEST_SIZE WC_SHA3_224_DIGEST_SIZE 74 #define SHA3_256 WC_SHA3_256 75 #define SHA3_256_DIGEST_SIZE WC_SHA3_256_DIGEST_SIZE 76 #define SHA3_384 WC_SHA3_384 77 #define SHA3_384_DIGEST_SIZE WC_SHA3_384_DIGEST_SIZE 78 #define SHA3_512 WC_SHA3_512 79 #define SHA3_512_DIGEST_SIZE WC_SHA3_512_DIGEST_SIZE 85 #ifdef WOLFSSL_XILINX_CRYPT 86 #include "wolfssl/wolfcrypt/port/xilinx/xil-sha3.h" 87 #elif defined(WOLFSSL_AFALG_XILINX_SHA3) 88 #include <wolfssl/wolfcrypt/port/af_alg/afalg_hash.h> 102 #ifdef WOLFSSL_ASYNC_CRYPT 103 WC_ASYNC_DEV asyncDev;
105 #if defined(WOLFSSL_HASH_FLAGS) || defined(WOLF_CRYPTO_CB) 110 #ifndef WC_SHA3_TYPE_DEFINED 112 #define WC_SHA3_TYPE_DEFINED 120 WOLFSSL_API
int wc_InitSha3_224(
wc_Sha3*,
void*,
int);
121 WOLFSSL_API
int wc_Sha3_224_Update(
wc_Sha3*,
const byte*, word32);
122 WOLFSSL_API
int wc_Sha3_224_Final(
wc_Sha3*, byte*);
123 WOLFSSL_API
void wc_Sha3_224_Free(
wc_Sha3*);
124 WOLFSSL_API
int wc_Sha3_224_GetHash(
wc_Sha3*, byte*);
127 WOLFSSL_API
int wc_InitSha3_256(
wc_Sha3*,
void*,
int);
128 WOLFSSL_API
int wc_Sha3_256_Update(
wc_Sha3*,
const byte*, word32);
129 WOLFSSL_API
int wc_Sha3_256_Final(
wc_Sha3*, byte*);
130 WOLFSSL_API
void wc_Sha3_256_Free(
wc_Sha3*);
131 WOLFSSL_API
int wc_Sha3_256_GetHash(
wc_Sha3*, byte*);
134 WOLFSSL_API
int wc_InitSha3_384(
wc_Sha3*,
void*,
int);
135 WOLFSSL_API
int wc_Sha3_384_Update(
wc_Sha3*,
const byte*, word32);
136 WOLFSSL_API
int wc_Sha3_384_Final(
wc_Sha3*, byte*);
137 WOLFSSL_API
void wc_Sha3_384_Free(
wc_Sha3*);
138 WOLFSSL_API
int wc_Sha3_384_GetHash(
wc_Sha3*, byte*);
141 WOLFSSL_API
int wc_InitSha3_512(
wc_Sha3*,
void*,
int);
142 WOLFSSL_API
int wc_Sha3_512_Update(
wc_Sha3*,
const byte*, word32);
143 WOLFSSL_API
int wc_Sha3_512_Final(
wc_Sha3*, byte*);
144 WOLFSSL_API
void wc_Sha3_512_Free(
wc_Sha3*);
145 WOLFSSL_API
int wc_Sha3_512_GetHash(
wc_Sha3*, byte*);
148 WOLFSSL_API
int wc_InitShake256(
wc_Shake*,
void*,
int);
149 WOLFSSL_API
int wc_Shake256_Update(
wc_Shake*,
const byte*, word32);
150 WOLFSSL_API
int wc_Shake256_Final(
wc_Shake*, byte*, word32);
151 WOLFSSL_API
void wc_Shake256_Free(
wc_Shake*);
154 #if defined(WOLFSSL_HASH_FLAGS) || defined(WOLF_CRYPTO_CB) 155 WOLFSSL_API
int wc_Sha3_SetFlags(
wc_Sha3* sha3, word32 flags);
156 WOLFSSL_API
int wc_Sha3_GetFlags(
wc_Sha3* sha3, word32* flags);
Definition: afalg_hash.h:31