Bip85 Functions

int bip85_get_languages(char **output)

Get the list of default supported languages for BIP85.

Note

The string returned should be freed using wally_free_string.

Returns:

See Error Codes

int bip85_get_bip39_entropy(const struct ext_key *hdkey, const char *lang, uint32_t num_words, uint32_t index, unsigned char *bytes_out, size_t len, size_t *written)

Generate BIP39 mnemonic entropy according to BIP85.

Parameters:
  • hdkey – The parent extended key to derive mnemonic entropy from.

  • lang – The intended language. Pass NULL to use the default English value.

  • num_words – The intended number of words. Must be 12, 18 or 24.

  • index – The index used to create the entropy. Must be less than BIP32_INITIAL_HARDENED_CHILD.

  • bytes_out – Destination for the resulting entropy.

  • len – Size of bytes_out. Passing HMAC_SHA512_LEN will ensure the buffer is large enough.

  • written – Destination for the number of bytes written to bytes_out.

Returns:

See Variable Length Output Buffers

int bip85_get_rsa_entropy(const struct ext_key *hdkey, uint32_t key_bits, uint32_t index, unsigned char *bytes_out, size_t len, size_t *written)

Generate entropy for seeding RSA key generation according to BIP85.

Parameters:
  • hdkey – The parent extended key to derive RSA entropy from.

  • key_bits – The intended RSA key size in bits.

  • index – The index used to create the entropy. Must be less than BIP32_INITIAL_HARDENED_CHILD.

  • bytes_out – Destination for the resulting entropy.

  • len – Size of bytes_out. Passing HMAC_SHA512_LEN will ensure the buffer is large enough.

  • written – Destination for the number of bytes written to bytes_out.

Note

This function always returns HMAC_SHA512_LEN bytes on success.

Note

The returned entropy must be given to BIP85-DRNG in order to derive the RSA key to use. It MUST NOT be used directly.

Returns:

See Variable Length Output Buffers