summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTodd Short <tshort@akamai.com>2016-12-16 17:00:43 -0500
committerRichard Levitte <levitte@openssl.org>2017-01-24 15:40:37 +0100
commit52ad5b60e3a1fef12a1a5ea01527a90b8f92a34b (patch)
tree74ef6b469ac271f35b5573738ca00edf38cff89e /include
parent07afdf3c3ac97af4f2b4eec22a97f7230f8227e0 (diff)
Add support for Poly1305 in EVP_PKEY
Add Poly1305 as a "signed" digest. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2128)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/evp.h11
-rw-r--r--include/openssl/obj_mac.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/include/openssl/evp.h b/include/openssl/evp.h
index 00c3a3dcf1..fda0713ce4 100644
--- a/include/openssl/evp.h
+++ b/include/openssl/evp.h
@@ -53,6 +53,7 @@
# define EVP_PKEY_CMAC NID_cmac
# define EVP_PKEY_TLS1_PRF NID_tls1_prf
# define EVP_PKEY_HKDF NID_hkdf
+# define EVP_PKEY_POLY1305 NID_poly1305
#ifdef __cplusplus
extern "C" {
@@ -398,6 +399,11 @@ typedef int (EVP_PBE_KEYGEN) (EVP_CIPHER_CTX *ctx, const char *pass,
(char *)(eckey))
# endif
+# ifndef OPENSSL_NO_POLY1305
+# define EVP_PKEY_assign_POLY1305(pkey,polykey) EVP_PKEY_assign((pkey),EVP_PKEY_POLY1305,\
+ (char *)(polykey))
+# endif
+
/* Add some extra combinations */
# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))
# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a))
@@ -904,6 +910,9 @@ int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len);
int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key);
void *EVP_PKEY_get0(const EVP_PKEY *pkey);
const unsigned char *EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len);
+# ifndef OPENSSL_NO_POLY1305
+const unsigned char *EVP_PKEY_get0_poly1305(const EVP_PKEY *pkey, size_t *len);
+# endif
# ifndef OPENSSL_NO_RSA
struct rsa_st;
@@ -1500,6 +1509,7 @@ int ERR_load_EVP_strings(void);
# define EVP_F_EVP_PKEY_GET0_DSA 120
# define EVP_F_EVP_PKEY_GET0_EC_KEY 131
# define EVP_F_EVP_PKEY_GET0_HMAC 183
+# define EVP_F_EVP_PKEY_GET0_POLY1305 169
# define EVP_F_EVP_PKEY_GET0_RSA 121
# define EVP_F_EVP_PKEY_KEYGEN 146
# define EVP_F_EVP_PKEY_KEYGEN_INIT 147
@@ -1544,6 +1554,7 @@ int ERR_load_EVP_strings(void);
# define EVP_R_EXPECTING_A_DH_KEY 128
# define EVP_R_EXPECTING_A_DSA_KEY 129
# define EVP_R_EXPECTING_A_EC_KEY 142
+# define EVP_R_EXPECTING_A_POLY1305_KEY 164
# define EVP_R_FIPS_MODE_NOT_SUPPORTED 167
# define EVP_R_ILLEGAL_SCRYPT_PARAMETERS 171
# define EVP_R_INITIALIZATION_ERROR 134
diff --git a/include/openssl/obj_mac.h b/include/openssl/obj_mac.h
index f97f3eaa17..faeb67526f 100644
--- a/include/openssl/obj_mac.h
+++ b/include/openssl/obj_mac.h
@@ -4575,3 +4575,7 @@
#define SN_auth_null "AuthNULL"
#define LN_auth_null "auth-null"
#define NID_auth_null 1053
+
+#define SN_poly1305 "Poly1305"
+#define LN_poly1305 "poly1305"
+#define NID_poly1305 1061