/*1* Copyright (c) 2018-2021 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_ES256_H29#define _FIDO_ES256_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 */4546es256_pk_t *es256_pk_new(void);47void es256_pk_free(es256_pk_t **);48EVP_PKEY *es256_pk_to_EVP_PKEY(const es256_pk_t *);4950int es256_pk_from_EC_KEY(es256_pk_t *, const EC_KEY *);51int es256_pk_from_EVP_PKEY(es256_pk_t *, const EVP_PKEY *);52int es256_pk_from_ptr(es256_pk_t *, const void *, size_t);5354#ifdef _FIDO_INTERNAL55es256_sk_t *es256_sk_new(void);56void es256_sk_free(es256_sk_t **);57EVP_PKEY *es256_sk_to_EVP_PKEY(const es256_sk_t *);5859int es256_derive_pk(const es256_sk_t *, es256_pk_t *);60int es256_sk_create(es256_sk_t *);6162int es256_pk_set_x(es256_pk_t *, const unsigned char *);63int es256_pk_set_y(es256_pk_t *, const unsigned char *);64#endif6566#ifdef __cplusplus67} /* extern "C" */68#endif /* __cplusplus */6970#endif /* !_FIDO_ES256_H */717273