lcx_sha512.h Previous Back to the files list SHA-2 (Secure Hash Algorithm 2) More... Data Structures struct cx_sha512_s SHA-384 and SHA-512 context. More... Macros #define CX_SHA384_SIZE 48 SHA-384 message digest size. More... #define CX_SHA512_SIZE 64 SHA-512 message digest size. More... Typedefs typedef struct cx_sha512_s cx_sha512_t Convenience type. More... Functions cx_err_t cx_sha384_init_no_throw (cx_sha512_t *hash) Initializes a SHA-384 context. More... static int cx_sha384_init (cx_sha512_t *hash) Initializes a SHA-384 context. More... cx_err_t cx_sha512_init_no_throw (cx_sha512_t *hash) Initializes a SHA-512 context. More... static int cx_sha512_init (cx_sha512_t *hash) Initializes a SHA-512 context. More... size_t cx_hash_sha512 (const uint8_t *in, size_t in_len, uint8_t *out, size_t out_len) Computes a one shot SHA-512 digest. More... Detailed Description SHA-2 (Secure Hash Algorithm 2) SHA-384 and SHA-512 are secure hash functions belonging to the SHA-2 family with a digest length of 384 and 512 bits, respectively. The message length should be less than 2128 bits. Refer to FIPS 180-4 for more details. Macro Definition Documentation CX_SHA384_SIZE #define CX_SHA384_SIZE 48 SHA-384 message digest size. CX_SHA512_SIZE #define CX_SHA512_SIZE 64 SHA-512 message digest size. Typedef Documentation cx_sha512_t typedef struct cx_sha512_s cx_sha512_t Convenience type. See cx_sha512_s. Function Documentation cx_hash_sha512() size_t cx_hash_sha512 ( const uint8_t * in, size_t in_len, uint8_t * out, size_t out_len ) Computes a one shot SHA-512 digest. Parameters [in]inInput data. [in]in_lenLength of the input data. [out]outBuffer where to store the output. [out]out_lenLength of the output. This is actually 512 bits. cx_sha384_init() static int cx_sha384_init ( cx_sha512_t * hash) Initializes a SHA-384 context. Parameters [out]hashPointer to the context. The context shall be in RAM. ReturnsSHA384 identifier. cx_sha384_init_no_throw() cx_err_t cx_sha384_init_no_throw ( cx_sha512_t * hash) Initializes a SHA-384 context. Parameters [out]hashPointer to the context. The context shall be in RAM. ReturnsError code: CX_OK on success cx_sha512_init() static int cx_sha512_init ( cx_sha512_t * hash) Initializes a SHA-512 context. Parameters [out]hashPointer to the context. The context shall be in RAM. ReturnsSHA512 identifier. cx_sha512_init_no_throw() cx_err_t cx_sha512_init_no_throw ( cx_sha512_t * hash) Initializes a SHA-512 context. Parameters [out]hashPointer to the context. The context shall be in RAM. ReturnsError code: CX_OK on success 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.