lcx_sha256.h Previous Back to the files list SHA-2 (Secure Hash Algorithm 2) More... Data Structures struct cx_sha256_s SHA-224 and SHA-256 context. More... Macros #define CX_SHA224_SIZE 28 SHA-224 message digest size. More... #define CX_SHA256_SIZE 32 SHA-256 message digest size. More... Typedefs typedef struct cx_sha256_s cx_sha256_t Convenience type. More... Functions cx_err_t cx_sha224_init_no_throw (cx_sha256_t *hash) Initializes a SHA-224 context. More... static int cx_sha224_init (cx_sha256_t *hash) Initializes a SHA-224 context. More... cx_err_t cx_sha256_init_no_throw (cx_sha256_t *hash) Initializes a SHA-256 context. More... static int cx_sha256_init (cx_sha256_t *hash) Initializes a SHA-256 context. More... size_t cx_hash_sha256 (const uint8_t *in, size_t len, uint8_t *out, size_t out_len) Computes a one shot SHA-256 digest. More... Detailed Description SHA-2 (Secure Hash Algorithm 2) SHA-224 and SHA-256 are secure hash functions belonging to the SHA-2 family with a digest length of 224 and 256 bits, respectively. The message length should be less than 264 bits. Refer to FIPS 180-4 for more details. Macro Definition Documentation CX_SHA224_SIZE #define CX_SHA224_SIZE 28 SHA-224 message digest size. CX_SHA256_SIZE #define CX_SHA256_SIZE 32 SHA-256 message digest size. Typedef Documentation cx_sha256_t typedef struct cx_sha256_s cx_sha256_t Convenience type. See cx_sha256_s. Function Documentation cx_hash_sha256() size_t cx_hash_sha256 ( const uint8_t * in, size_t len, uint8_t * out, size_t out_len ) Computes a one shot SHA-256 digest. Parameters [in]inInput data. [in]lenLength of the input data. [out]outBuffer where to store the digest. [in]out_lenLength of the output. This is actually 256 bits. cx_sha224_init() static int cx_sha224_init ( cx_sha256_t * hash) Initializes a SHA-224 context. Parameters [out]hashPointer to the context. The context shall be in RAM. ReturnsSHA224 identifier. cx_sha224_init_no_throw() cx_err_t cx_sha224_init_no_throw ( cx_sha256_t * hash) Initializes a SHA-224 context. Parameters [out]hashPointer to the context. The context shall be in RAM. ReturnsError code: CX_OK on success cx_sha256_init() static int cx_sha256_init ( cx_sha256_t * hash) Initializes a SHA-256 context. Parameters [out]hashPointer to the context. The context shall be in RAM. ReturnsSHA256 identifier. cx_sha256_init_no_throw() cx_err_t cx_sha256_init_no_throw ( cx_sha256_t * hash) Initializes a SHA-256 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.