wickr-crypto-c

devinfo.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 devinfo_h
23 #define devinfo_h
24
25 #include <stdlib.h>
26 #include "buffer.h"
27 #include "crypto_engine.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
58 struct wickr_dev_info {
59 wickr_buffer_t *dev_salt;
60 wickr_buffer_t *system_salt;
61 wickr_buffer_t *msg_proto_id;
62 wickr_buffer_t *srv_comm_id;
63 };
64
65 typedef struct wickr_dev_info wickr_dev_info_t;
66
79 wickr_dev_info_t *wickr_dev_info_create(wickr_buffer_t *dev_salt, wickr_buffer_t *system_salt, wickr_buffer_t *msg_proto_id, wickr_buffer_t *srv_comm_id);
80
91 wickr_dev_info_t *wickr_dev_info_create_new(const wickr_crypto_engine_t *crypto, const wickr_buffer_t *system_id);
92
93
105 wickr_dev_info_t *wickr_dev_info_derive(const wickr_crypto_engine_t *crypto, wickr_buffer_t *dev_salt, const wickr_buffer_t *system_id);
106
116 wickr_dev_info_t *wickr_dev_info_copy(const wickr_dev_info_t *info);
117
126 void wickr_dev_info_destroy(wickr_dev_info_t **info);
127
128 #ifdef __cplusplus
129 }
130 #endif
131
132 #endif /* devinfo_h */
wickr_dev_info_destroy
void wickr_dev_info_destroy(wickr_dev_info_t **info)
wickr_dev_info_copy
wickr_dev_info_t * wickr_dev_info_copy(const wickr_dev_info_t *info)
wickr_dev_info_derive
wickr_dev_info_t * wickr_dev_info_derive(const wickr_crypto_engine_t *crypto, wickr_buffer_t *dev_salt, const wickr_buffer_t *system_id)
wickr_dev_info_create
wickr_dev_info_t * wickr_dev_info_create(wickr_buffer_t *dev_salt, wickr_buffer_t *system_salt, wickr_buffer_t *msg_proto_id, wickr_buffer_t *srv_comm_id)
wickr_dev_info_create_new
wickr_dev_info_t * wickr_dev_info_create_new(const wickr_crypto_engine_t *crypto, const wickr_buffer_t *system_id)
wickr_buffer
Represents an array of bytes and the length of the allocation associated with those bytes.
Definition: buffer.h:51
wickr_crypto_engine
Interface to a set of cryptographic operations used throughout the library. Currently the default imp...
Definition: crypto_engine.h:53
wickr_dev_info
Device Information used to make a uniquely identifying set of data for each context running the Wickr...
Definition: devinfo.h:58
wickr_dev_info::system_salt
wickr_buffer_t * system_salt
Definition: devinfo.h:60
wickr_dev_info::dev_salt
wickr_buffer_t * dev_salt
Definition: devinfo.h:59
wickr_dev_info::msg_proto_id
wickr_buffer_t * msg_proto_id
Definition: devinfo.h:61
wickr_dev_info::srv_comm_id
wickr_buffer_t * srv_comm_id
Definition: devinfo.h:62