summaryrefslogtreecommitdiff
path: root/src/fido/eddsa.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fido/eddsa.h')
-rw-r--r--src/fido/eddsa.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/fido/eddsa.h b/src/fido/eddsa.h
new file mode 100644
index 0000000..9de272d
--- /dev/null
+++ b/src/fido/eddsa.h
@@ -0,0 +1,40 @@
1/*
2 * Copyright (c) 2019 Yubico AB. All rights reserved.
3 * Use of this source code is governed by a BSD-style
4 * license that can be found in the LICENSE file.
5 */
6
7#ifndef _FIDO_EDDSA_H
8#define _FIDO_EDDSA_H
9
10#include <openssl/ec.h>
11
12#include <stdint.h>
13#include <stdlib.h>
14
15eddsa_pk_t *eddsa_pk_new(void);
16void eddsa_pk_free(eddsa_pk_t **);
17EVP_PKEY *eddsa_pk_to_EVP_PKEY(const eddsa_pk_t *);
18
19int eddsa_pk_from_EVP_PKEY(eddsa_pk_t *, const EVP_PKEY *);
20int eddsa_pk_from_ptr(eddsa_pk_t *, const void *, size_t);
21
22#ifdef _FIDO_INTERNAL
23
24#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10101000L
25#define EVP_PKEY_ED25519 EVP_PKEY_NONE
26int EVP_PKEY_get_raw_public_key(const EVP_PKEY *, unsigned char *, size_t *);
27EVP_PKEY *EVP_PKEY_new_raw_public_key(int, ENGINE *, const unsigned char *,
28 size_t);
29int EVP_DigestVerify(EVP_MD_CTX *, const unsigned char *, size_t,
30 const unsigned char *, size_t);
31#endif /* LIBRESSL_VERSION_NUMBER || OPENSSL_VERSION_NUMBER < 0x10101000L */
32
33#if OPENSSL_VERSION_NUMBER < 0x10100000L
34EVP_MD_CTX *EVP_MD_CTX_new(void);
35void EVP_MD_CTX_free(EVP_MD_CTX *);
36#endif
37
38#endif /* _FIDO_INTERNAL */
39
40#endif /* !_FIDO_EDDSA_H */