lcx_blake2.h Previous Back to the files list BLAKE2 crypographic hash function. More... Data Structures struct blake2b_state__ BLAKE2b state members. More... struct cx_blake2b_s BLAKE2b context. More... Typedefs typedef struct blake2b_state__ blake2b_state BLAKE2b state. More... typedef struct cx_blake2b_s cx_blake2b_t Convenience type. More... Enumerations enum blake2b_constant { BLAKE2B_BLOCKBYTES = 128, BLAKE2B_OUTBYTES = 64, BLAKE2B_KEYBYTES = 64, BLAKE2B_SALTBYTES = 16, BLAKE2B_PERSONALBYTES = 16 } BLAKE2b constants. More... Functions cx_err_t cx_blake2b_init_no_throw (cx_blake2b_t *hash, size_t out_len) Initializes BLAKE2b message digest context. More... static int cx_blake2b_init (cx_blake2b_t *hash, unsigned int out_len) Initializes BLAKE2b message digest context. More... cx_err_t cx_blake2b_init2_no_throw (cx_blake2b_t *hash, size_t out_len, uint8_t *salt, size_t salt_len, uint8_t *perso, size_t perso_len) Initializes BLAKE2b message digest context with salt and personnalization string. More... static int cx_blake2b_init2 (cx_blake2b_t *hash, unsigned int out_len, unsigned char *salt, unsigned int salt_len, unsigned char *perso, unsigned int perso_len) Initializes BLAKE2b message digest context with salt and personnalization string. More... Detailed Description BLAKE2 crypographic hash function. BLAKE2b is a cryptographic hash function optimized for 64-bit platforms that produces digests of any size between 1 and 64 bytes. It is specified at https://blake2.net. Typedef Documentation blake2b_state typedef struct blake2b_state__ blake2b_state BLAKE2b state. cx_blake2b_t typedef struct cx_blake2b_s cx_blake2b_t Convenience type. See cx_blake2b_s. Enumeration Type Documentation blake2b_constant enum blake2b_constant BLAKE2b constants. EnumeratorBLAKE2B_BLOCKBYTES Size of a block. BLAKE2B_OUTBYTES Size of the output. BLAKE2B_KEYBYTES Size of the key. BLAKE2B_SALTBYTES Size of the salt. BLAKE2B_PERSONALBYTES Size of the personalization string. Function Documentation cx_blake2b_init() static int cx_blake2b_init ( cx_blake2b_t * hash, unsigned int out_len ) Initializes BLAKE2b message digest context. This function throws an exception if the initialization fails. WarningIt is recommended to use cx_blake2b_init_no_throw rather than this function. Parameters [out]hashPointer to the BLAKE2b context to initialize. The context shall be in RAM. [in]out_lenDigest size in bits. ReturnsBLAKE2b identifier. Exceptions CX_INVALID_PARAMETER cx_blake2b_init2() static int cx_blake2b_init2 ( cx_blake2b_t * hash, unsigned int out_len, unsigned char * salt, unsigned int salt_len, unsigned char * perso, unsigned int perso_len ) Initializes BLAKE2b message digest context with salt and personnalization string. This function throws an exception if the initialization fails. WarningIt is recommended to use cx_blake2b_init2_no_throw rather than this function. Parameters [out]hashPointer to the BLAKE2b context to initialize. The context shall be in RAM. [in]out_lenDigest size in bits. [in]saltPointer to a salt (optional). [in]salt_lenLength of the salt. [in]persoPointer to a personalization string (optional). [in]perso_lenLength of the personalization string. ReturnsBLAKE2b identifier. Exceptions CX_INVALID_PARAMETER cx_blake2b_init2_no_throw() cx_err_t cx_blake2b_init2_no_throw ( cx_blake2b_t * hash, size_t out_len, uint8_t * salt, size_t salt_len, uint8_t * perso, size_t perso_len ) Initializes BLAKE2b message digest context with salt and personnalization string. Parameters [out]hashPointer to the BLAKE2b context to initialize. The context shall be in RAM. [in]out_lenDigest size in bits. [in]saltPointer to a salt (optional). [in]salt_lenLength of the salt. [in]persoPointer to a personalization string (optional). [in]perso_lenLength of the personalization string. ReturnsError code: CX_OK on success CX_INVALID_PARAMETER cx_blake2b_init_no_throw() cx_err_t cx_blake2b_init_no_throw ( cx_blake2b_t * hash, size_t out_len ) Initializes BLAKE2b message digest context. Parameters [out]hashPointer to the BLAKE2b context to initialize. The context shall be in RAM. [in]out_lenDigest size in bits. ReturnsError code: CX_OK CX_INVALID_PARAMETER Previous Back to the files list Did you find this page helpful? How would you improve this page for developers? I am a developer. Contributors will be chosen randomly to receive rewards. Check this box to send your email and participate. Ledger collects your email address to send you rewards for your contribution to improve the Developer Portal documentation. Learn more about how we manage your data and your rights. By providing your email address, you consent that Ledger may contact you for rewards delivery purposes. If you are part of the randomly selected contributors, we will send you an email to ask for your physical address and if necessary, ask you for additional information on the suggestion you made. Your information will only be available to Ledger and will be retained for no longer than 90 days. It may be transferred to non-European countries that ensure an adequate level of protection or under the standard contractual clauses adopted by the EU Commission. Please note that you may withdraw your consent at any time, access your data and request their rectification or deletion. You may also request the limitation of the processing of your data. To exercise your rights or for any question on the processing of your data, please contact LEDGER’s Data Protection Officer here. If nevertheless you believe LEDGER did not adequately address your concerns and mishandled your data, you may lodge a complaint with the personal data protection authority of your country.