ica_sha384
Purpose
Performs a secure hash on the input data using the SHA-384 algorithm.
Format
unsigned int ica_sha384(unsigned int message_part,
uint64_t input_length,
const unsigned char *input_data,
sha512_context_t *sha512_context,
unsigned char *output_data);
Required hardware support
KIMD-SHA-512 and KLMD-SHA-512
Parameters
- unsigned int message_part
- The message chaining state. This parameter must be one of the
following values:
- SHA_MSG_PART_ONLY
- A single hash operation
- SHA_MSG_PART_FIRST
- The first part
- SHA_MSG_PART_MIDDLE
- The middle part
- SHA_MSG_PART_FINAL
- The last part
- uint64_t input_length
- Length in bytes of the input data to be hashed using the SHA-384 algorithm. For SHA_MSG_PART_FIRST and SHA_MSG_PART_MIDDLE calls, the byte length must be a multiple of 128, that is, the SHA-384 block size.
- const unsigned char *input_data
- Pointer to the input data to be hashed. This pointer must not be zero. So even in case of zero size message data, it must be set to a valid value.
- sha512_context_t *sha512_context
- Pointer to the SHA-512 context structure used to store intermediate values needed when chaining
is used. The contents are ignored for message part SHA_MSG_PART_ONLY and SHA_MSG_PART_FIRST. This
structure must contain the returned value of the preceding call to
ica_sha384 for message part SHA_MSG_PART_MIDDLE and SHA_MSG_PART_FINAL.
For message part SHA_MSG_PART_FIRST and SHA_MSG_PART_FINAL, the returned value can be used for a
chained call of ica_sha384. Therefore, the application must not modify the
contents of this structure in between chained calls. Note: SHA-384 also uses a SHA-512 context
- unsigned char *output_data
- Pointer to the buffer to contain the resulting hash data. The resulting output data has a length of SHA384_HASH_LENGTH. Make sure that the buffer is at least this size.
Return codes
- 0
- Success
For return codes indicating exceptions, see Return codes.