26 #ifndef WOLF_CRYPT_DES3_H 27 #define WOLF_CRYPT_DES3_H 33 #if defined(HAVE_FIPS) && \ 34 defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) 35 #include <wolfssl/wolfcrypt/fips.h> 38 #if defined(HAVE_FIPS) && \ 39 (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2)) 41 #include <cyassl/ctaocrypt/des3.h> 57 #if !defined(HAVE_FIPS) || \ 58 (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)) 60 #ifdef WOLFSSL_ASYNC_CRYPT 61 #include <wolfssl/wolfcrypt/async.h> 65 DES_ENC_TYPE = WC_CIPHER_DES,
66 DES3_ENC_TYPE = WC_CIPHER_DES3,
78 #define DES3_KEYLEN 24 81 #if defined(STM32_CRYPTO) 91 word32 reg[DES_BLOCK_SIZE /
sizeof(word32)];
92 word32 tmp[DES_BLOCK_SIZE /
sizeof(word32)];
93 word32 key[DES_KS_SIZE];
99 word32 key[3][DES_KS_SIZE];
100 word32 reg[DES_BLOCK_SIZE /
sizeof(word32)];
101 word32 tmp[DES_BLOCK_SIZE /
sizeof(word32)];
102 #ifdef WOLFSSL_ASYNC_CRYPT 103 WC_ASYNC_DEV asyncDev;
105 #if defined(WOLF_CRYPTO_CB) || \ 106 (defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_3DES)) 107 word32 devKey[DES3_KEYLEN/
sizeof(word32)];
109 #ifdef WOLF_CRYPTO_CB 116 #ifndef WC_DES3_TYPE_DEFINED 118 #define WC_DES3_TYPE_DEFINED 124 const byte* iv,
int dir);
127 const byte* in, word32 sz);
129 const byte* in, word32 sz);
131 const byte* in, word32 sz);
133 const byte* in, word32 sz);
136 #define wc_Des_EcbDecrypt wc_Des_EcbEncrypt 137 #define wc_Des3_EcbDecrypt wc_Des3_EcbEncrypt 140 const byte* iv,
int dir);
143 const byte* in,word32 sz);
145 const byte* in,word32 sz);
149 WOLFSSL_API
int wc_Des3Init(
Des3*,
void*,
int);
150 WOLFSSL_API
void wc_Des3Free(
Des3*);
WOLFSSL_API int wc_Des3_CbcDecrypt(Des3 *des, byte *out, const byte *in, word32 sz)
This function decrypts the input ciphertext, in, and stores the resulting plaintext in the output buf...
Definition: des3.c:471
WOLFSSL_API int wc_Des3_CbcEncrypt(Des3 *des, byte *out, const byte *in, word32 sz)
This function encrypts the input message, in, and stores the result in the output buffer...
Definition: des3.c:465
WOLFSSL_API void wc_Des_SetIV(Des *des, const byte *iv)
This function sets the initialization vector (iv) for the Des structure given as argument. When passed a NULL iv, it sets the initialization vector to 0.
Definition: des3.c:1762
WOLFSSL_API int wc_Des3_SetKey(Des3 *des, const byte *key, const byte *iv, int dir)
This function sets the key and initialization vector (iv) for the Des3 structure given as argument...
Definition: des3.c:168
WOLFSSL_API int wc_Des_SetKey(Des *des, const byte *key, const byte *iv, int dir)
This function sets the key and initialization vector (iv) for the Des structure given as argument...
Definition: des3.c:152
WOLFSSL_API int wc_Des3_EcbEncrypt(Des3 *des, byte *out, const byte *in, word32 sz)
This function encrypts the input message, in, and stores the result in the output buffer...
Definition: des3.c:1152
WOLFSSL_API int wc_Des_CbcEncrypt(Des *des, byte *out, const byte *in, word32 sz)
This function encrypts the input message, in, and stores the result in the output buffer...
Definition: des3.c:330
WOLFSSL_API int wc_Des3_SetIV(Des3 *des, const byte *iv)
This function sets the initialization vector (iv) for the Des3 structure given as argument...
Definition: des3.c:1770
WOLFSSL_API int wc_Des_CbcDecrypt(Des *des, byte *out, const byte *in, word32 sz)
This function decrypts the input ciphertext, in, and stores the resulting plaintext in the output buf...
Definition: des3.c:336
WOLFSSL_API int wc_Des_EcbEncrypt(Des *des, byte *out, const byte *in, word32 sz)
This function encrypts the input message, in, and stores the result in the output buffer...
Definition: des3.c:342