xref: /freebsd/contrib/libfido2/src/fido/es384.h (revision 2ccfa855b2fc331819953e3de1b1c15ce5b95a7e)
1*2ccfa855SEd Maste /*
2*2ccfa855SEd Maste  * Copyright (c) 2022 Yubico AB. All rights reserved.
3*2ccfa855SEd Maste  * SPDX-License-Identifier: BSD-2-Clause
4*2ccfa855SEd Maste  *
5*2ccfa855SEd Maste  * Redistribution and use in source and binary forms, with or without
6*2ccfa855SEd Maste  * modification, are permitted provided that the following conditions are
7*2ccfa855SEd Maste  * met:
8*2ccfa855SEd Maste  *
9*2ccfa855SEd Maste  *    1. Redistributions of source code must retain the above copyright
10*2ccfa855SEd Maste  *       notice, this list of conditions and the following disclaimer.
11*2ccfa855SEd Maste  *    2. Redistributions in binary form must reproduce the above copyright
12*2ccfa855SEd Maste  *       notice, this list of conditions and the following disclaimer in
13*2ccfa855SEd Maste  *       the documentation and/or other materials provided with the
14*2ccfa855SEd Maste  *       distribution.
15*2ccfa855SEd Maste  *
16*2ccfa855SEd Maste  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17*2ccfa855SEd Maste  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18*2ccfa855SEd Maste  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19*2ccfa855SEd Maste  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20*2ccfa855SEd Maste  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21*2ccfa855SEd Maste  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22*2ccfa855SEd Maste  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23*2ccfa855SEd Maste  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24*2ccfa855SEd Maste  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25*2ccfa855SEd Maste  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26*2ccfa855SEd Maste  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*2ccfa855SEd Maste  */
28*2ccfa855SEd Maste 
29*2ccfa855SEd Maste #ifndef _FIDO_ES384_H
30*2ccfa855SEd Maste #define _FIDO_ES384_H
31*2ccfa855SEd Maste 
32*2ccfa855SEd Maste #include <openssl/ec.h>
33*2ccfa855SEd Maste 
34*2ccfa855SEd Maste #include <stdint.h>
35*2ccfa855SEd Maste #include <stdlib.h>
36*2ccfa855SEd Maste 
37*2ccfa855SEd Maste #ifdef _FIDO_INTERNAL
38*2ccfa855SEd Maste #include "types.h"
39*2ccfa855SEd Maste #else
40*2ccfa855SEd Maste #include <fido.h>
41*2ccfa855SEd Maste #endif
42*2ccfa855SEd Maste 
43*2ccfa855SEd Maste #ifdef __cplusplus
44*2ccfa855SEd Maste extern "C" {
45*2ccfa855SEd Maste #endif /* __cplusplus */
46*2ccfa855SEd Maste 
47*2ccfa855SEd Maste es384_pk_t *es384_pk_new(void);
48*2ccfa855SEd Maste void es384_pk_free(es384_pk_t **);
49*2ccfa855SEd Maste EVP_PKEY *es384_pk_to_EVP_PKEY(const es384_pk_t *);
50*2ccfa855SEd Maste 
51*2ccfa855SEd Maste int es384_pk_from_EC_KEY(es384_pk_t *, const EC_KEY *);
52*2ccfa855SEd Maste int es384_pk_from_EVP_PKEY(es384_pk_t *, const EVP_PKEY *);
53*2ccfa855SEd Maste int es384_pk_from_ptr(es384_pk_t *, const void *, size_t);
54*2ccfa855SEd Maste 
55*2ccfa855SEd Maste #ifdef __cplusplus
56*2ccfa855SEd Maste } /* extern "C" */
57*2ccfa855SEd Maste #endif /* __cplusplus */
58*2ccfa855SEd Maste 
59*2ccfa855SEd Maste #endif /* !_FIDO_ES384_H */
60