Skip to content

Commit 8e60996

Browse files
committed
Initial implementation of ChaCha20Poly1305 AEAD for wolfProvider
1 parent b1a102e commit 8e60996

9 files changed

Lines changed: 1060 additions & 0 deletions

File tree

include/wolfprovider/alg_funcs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ typedef void (*DFUNC)(void);
122122

123123
#define WP_NAMES_DES_EDE3_CBC "DES-EDE3-CBC:DES3:1.2.840.113549.3.7"
124124

125+
#define WP_NAMES_CHACHA20_POLY1305 "ChaCha20-Poly1305"
126+
125127
/* Internal cipher flags. */
126128
#define WP_CIPHER_FLAG_AEAD 0x0001
127129
#define WP_CIPHER_FLAG_CUSTOM_IV 0x0002
@@ -284,6 +286,8 @@ extern const OSSL_DISPATCH wp_aes128wrap_functions[];
284286

285287
extern const OSSL_DISPATCH wp_des3cbc_functions[];
286288

289+
extern const OSSL_DISPATCH wp_chacha20_poly1305_functions[];
290+
287291
/* MAC implementations. */
288292
extern const OSSL_DISPATCH wp_hmac_functions[];
289293
extern const OSSL_DISPATCH wp_cmac_functions[];

include/wolfprovider/settings.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@
161161
#ifdef HAVE_ED448
162162
#define WP_HAVE_ED448
163163
#endif
164+
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
165+
#define WP_HAVE_CHACHAPOLY
166+
#endif
164167
#ifndef WP_NO_FORCE_FAIL
165168
#define WP_CHECK_FORCE_FAIL
166169
#endif

src/include.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ libwolfprov_la_SOURCES += src/wp_aes_block.c
1010
libwolfprov_la_SOURCES += src/wp_aes_stream.c
1111
libwolfprov_la_SOURCES += src/wp_aes_aead.c
1212
libwolfprov_la_SOURCES += src/wp_aes_wrap.c
13+
libwolfprov_la_SOURCES += src/wp_chachapoly_aead.c
1314
libwolfprov_la_SOURCES += src/wp_des.c
1415
libwolfprov_la_SOURCES += src/wp_hmac.c
1516
libwolfprov_la_SOURCES += src/wp_cmac.c

0 commit comments

Comments
 (0)