/*1* Copyright (c) 2019 Yubico AB. All rights reserved.2* SPDX-License-Identifier: BSD-2-Clause3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions are6* met:7*8* 1. Redistributions of source code must retain the above copyright9* notice, this list of conditions and the following disclaimer.10* 2. Redistributions in binary form must reproduce the above copyright11* notice, this list of conditions and the following disclaimer in12* the documentation and/or other materials provided with the13* distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS16* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT17* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR18* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT19* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,20* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT21* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,22* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY23* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE25* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.26*/2728#ifndef _FIDO_EDDSA_H29#define _FIDO_EDDSA_H3031#include <openssl/ec.h>3233#include <stdint.h>34#include <stdlib.h>3536#ifdef _FIDO_INTERNAL37#include "types.h"38#else39#include <fido.h>40#endif4142#ifdef __cplusplus43extern "C" {44#endif /* __cplusplus */4546eddsa_pk_t *eddsa_pk_new(void);47void eddsa_pk_free(eddsa_pk_t **);48EVP_PKEY *eddsa_pk_to_EVP_PKEY(const eddsa_pk_t *);4950int eddsa_pk_from_EVP_PKEY(eddsa_pk_t *, const EVP_PKEY *);51int eddsa_pk_from_ptr(eddsa_pk_t *, const void *, size_t);5253#ifdef _FIDO_INTERNAL5455#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x3070000f56#define EVP_PKEY_ED25519 EVP_PKEY_NONE57int EVP_PKEY_get_raw_public_key(const EVP_PKEY *, unsigned char *, size_t *);58EVP_PKEY *EVP_PKEY_new_raw_public_key(int, ENGINE *, const unsigned char *,59size_t);60int EVP_DigestVerify(EVP_MD_CTX *, const unsigned char *, size_t,61const unsigned char *, size_t);62#endif /* LIBRESSL_VERSION_NUMBER */6364#endif /* _FIDO_INTERNAL */6566#ifdef __cplusplus67} /* extern "C" */68#endif /* __cplusplus */6970#endif /* !_FIDO_EDDSA_H */717273