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