diff mbox series

[API-NEXT,v4,2/15] api: crypto: add ChaCha20-Poly1305 support

Message ID 1517331619-18755-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v4,1/15] api: crypto: add enumeration for AES-CMAC | expand

Commit Message

Github ODP bot Jan. 30, 2018, 5 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


ChaCha20-Poly1305 is a promising AEAD algorithm. Add decarations to
support it.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 434 (lumag:crypto-upd)
 ** https://github.com/Linaro/odp/pull/434
 ** Patch: https://github.com/Linaro/odp/pull/434.patch
 ** Base sha: 5718327018debbb02aacb464493504c95fbe57a3
 ** Merge commit sha: c5d9389a8d3b1a532e290aff4508756a920173ee
 **/
 include/odp/api/spec/crypto.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index 421080c2b..b7ab53620 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -101,6 +101,15 @@  typedef enum {
 	 */
 	ODP_CIPHER_ALG_AES_CCM,
 
+	/** ChaCha20-Poly1305
+	 *
+	 *  ChaCha20 with Poly1305 provide both authentication and ciphering of
+	 *  data (authenticated encryption) in the same operation. Hence this
+	 *  algorithm must be paired always with ODP_AUTH_ALG_CHACHA20_POLY1305
+	 *  authentication.
+	 */
+	ODP_CIPHER_ALG_CHACHA20_POLY1305,
+
 	/** @deprecated  Use ODP_CIPHER_ALG_AES_CBC instead */
 	ODP_DEPRECATE(ODP_CIPHER_ALG_AES128_CBC),
 
@@ -183,6 +192,15 @@  typedef enum {
 	 */
 	ODP_AUTH_ALG_AES_CMAC,
 
+	/** ChaCha20-Poly1305 AEAD
+	 *
+	 *  ChaCha20 with Poly1305 provide both authentication and ciphering of
+	 *  data (authenticated encryption) in the same operation. Hence this
+	 *  algorithm must be paired always with
+	 *  ODP_CIPHER_ALG_CHACHA20_POLY1305 cipher.
+	 */
+	ODP_AUTH_ALG_CHACHA20_POLY1305,
+
 	/** @deprecated  Use ODP_AUTH_ALG_MD5_HMAC instead */
 	ODP_DEPRECATE(ODP_AUTH_ALG_MD5_96),
 
@@ -221,6 +239,9 @@  typedef union odp_crypto_cipher_algos_t {
 		/** ODP_CIPHER_ALG_AES_CCM */
 		uint32_t aes_ccm     : 1;
 
+		/** ODP_CIPHER_ALG_CHACHA20_POLY1305 */
+		uint32_t chacha20_poly1305 : 1;
+
 		/** @deprecated  Use aes_cbc instead */
 		uint32_t ODP_DEPRECATE(aes128_cbc) : 1;
 
@@ -269,6 +290,9 @@  typedef union odp_crypto_auth_algos_t {
 		/** ODP_AUTH_ALG_AES_CMAC*/
 		uint32_t aes_cmac    : 1;
 
+		/** ODP_AUTH_ALG_CHACHA20_POLY1305 */
+		uint32_t chacha20_poly1305 : 1;
+
 		/** @deprecated  Use md5_hmac instead */
 		uint32_t ODP_DEPRECATE(md5_96)     : 1;