-
Notifications
You must be signed in to change notification settings - Fork 142
/
Copy pathwally_symmetric.h
50 lines (44 loc) · 1.37 KB
/
wally_symmetric.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef LIBWALLY_CORE_SYMMETRIC_H
#define LIBWALLY_CORE_SYMMETRIC_H
#include "wally_core.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Create a new symmetric parent key from entropy.
*
* :param bytes: Entropy to use.
* :param bytes_len: Size of ``bytes`` in bytes. Must be one of `BIP32_ENTROPY_LEN_128`,
*| `BIP32_ENTROPY_LEN_256` or `BIP32_ENTROPY_LEN_512`.
* :param bytes_out: Destination for the resulting parent key.
* FIXED_SIZED_OUTPUT(len, bytes_out, HMAC_SHA512_LEN)
*/
WALLY_CORE_API int wally_symmetric_key_from_seed(
const unsigned char *bytes,
size_t bytes_len,
unsigned char *bytes_out,
size_t len);
/**
*
* Create a new child symmetric key from a parent key.
*
* :param bytes: Parent key to use.
* :param bytes_len: Size of ``bytes`` in bytes. Must be `HMAC_SHA512_LEN`.
* :param version: Version byte to prepend to ``label``. Must be zero.
* :param label: Label to use for the child.
* :param label_len: Size of ``label`` in bytes.
* :param bytes_out: Destination for the resulting key.
* FIXED_SIZED_OUTPUT(len, bytes_out, HMAC_SHA512_LEN)
*/
WALLY_CORE_API int wally_symmetric_key_from_parent(
const unsigned char *bytes,
size_t bytes_len,
uint32_t version,
const unsigned char *label,
size_t label_len,
unsigned char *bytes_out,
size_t len);
#ifdef __cplusplus
}
#endif
#endif /* LIBWALLY_CORE_SYMMETRIC_H */