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