wickr-crypto-c

ecdsa.h
1 /*
2 * Copyright © 2012-2020 Wickr Inc. All rights reserved.
3 *
4 * This code is being released for EDUCATIONAL, ACADEMIC, AND CODE REVIEW PURPOSES
5 * ONLY. COMMERCIAL USE OF THE CODE IS EXPRESSLY PROHIBITED. For additional details,
6 * please see LICENSE
7 *
8 * THE CODE IS MADE AVAILABLE "AS-IS" AND WITHOUT ANY EXPRESS OR
9 * IMPLIED GUARANTEES AS TO FITNESS, MERCHANTABILITY, NON-
10 * INFRINGEMENT OR OTHERWISE. IT IS NOT BEING PROVIDED IN TRADE BUT ON
11 * A VOLUNTARY BASIS ON BEHALF OF THE AUTHOR’S PART FOR THE BENEFIT
12 * OF THE LICENSEE AND IS NOT MADE AVAILABLE FOR CONSUMER USE OR ANY
13 * OTHER USE OUTSIDE THE TERMS OF THIS LICENSE. ANYONE ACCESSING THE
14 * CODE SHOULD HAVE THE REQUISITE EXPERTISE TO SECURE THEIR SYSTEM
15 * AND DEVICES AND TO ACCESS AND USE THE CODE FOR REVIEW PURPOSES
16 * ONLY. LICENSEE BEARS THE RISK OF ACCESSING AND USING THE CODE. IN
17 * PARTICULAR, AUTHOR BEARS NO LIABILITY FOR ANY INTERFERENCE WITH OR
18 * ADVERSE EFFECT THAT MAY OCCUR AS A RESULT OF THE LICENSEE
19 * ACCESSING AND/OR USING THE CODE ON LICENSEE’S SYSTEM.
20 */
21
22 #ifndef ecdsa_h
23 #define ecdsa_h
24
25 #include <stdlib.h>
26 #include "eckey.h"
27 #include "digest.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
54 struct wickr_ecdsa_result {
55 wickr_ec_curve_t curve;
56 wickr_digest_t digest_mode;
57 wickr_buffer_t *sig_data;
58 };
59
60 typedef struct wickr_ecdsa_result wickr_ecdsa_result_t;
61
73 wickr_ecdsa_result_t *wickr_ecdsa_result_create(wickr_ec_curve_t curve, wickr_digest_t digest_mode, wickr_buffer_t *sig_data);
74
75
86 wickr_buffer_t *wickr_ecdsa_result_serialize(const wickr_ecdsa_result_t *result);
87
98 wickr_ecdsa_result_t *wickr_ecdsa_result_create_from_buffer(const wickr_buffer_t *buffer);
99
109 wickr_ecdsa_result_t *wickr_ecdsa_result_copy(const wickr_ecdsa_result_t *source);
110
119 void wickr_ecdsa_result_destroy(wickr_ecdsa_result_t **result);
120
121 #ifdef __cplusplus
122 }
123 #endif
124
125 #endif /* ecdsa_h */
wickr_ecdsa_result_serialize
wickr_buffer_t * wickr_ecdsa_result_serialize(const wickr_ecdsa_result_t *result)
wickr_ecdsa_result_create
wickr_ecdsa_result_t * wickr_ecdsa_result_create(wickr_ec_curve_t curve, wickr_digest_t digest_mode, wickr_buffer_t *sig_data)
wickr_ecdsa_result_destroy
void wickr_ecdsa_result_destroy(wickr_ecdsa_result_t **result)
wickr_ecdsa_result_copy
wickr_ecdsa_result_t * wickr_ecdsa_result_copy(const wickr_ecdsa_result_t *source)
wickr_ecdsa_result_create_from_buffer
wickr_ecdsa_result_t * wickr_ecdsa_result_create_from_buffer(const wickr_buffer_t *buffer)
wickr_buffer
Represents an array of bytes and the length of the allocation associated with those bytes.
Definition: buffer.h:51
wickr_digest
Digest function parameters.
Definition: digest.h:54
wickr_ec_curve
Metadata about curve types to help with key generation, and signatures.
Definition: eckey.h:67
wickr_ecdsa_result
Elliptic Curve Digital Signature Algorithm Result.
Definition: ecdsa.h:54
wickr_ecdsa_result::digest_mode
wickr_digest_t digest_mode
Definition: ecdsa.h:56
wickr_ecdsa_result::curve
wickr_ec_curve_t curve
Definition: ecdsa.h:55
wickr_ecdsa_result::sig_data
wickr_buffer_t * sig_data
Definition: ecdsa.h:57