SHA384 cryptographic hash.
◆ SharkSslSha384Ctx
In PSA consumer builds, hash contexts own provider operations.
Do not copy an active context with memcpy; use the corresponding clone function with an uninitialized target. Consumer methods return zero on success and -1 on error. Abort an unfinished context before reuse. SHA384
◆ sharkssl_sha384()
| int sharkssl_sha384 |
( |
const U8 * |
data, |
|
|
U32 |
len, |
|
|
U8 * |
digest |
|
) |
| |
sha384
- Parameters
-
| data | const U8 *; bytes to hash, borrowed for this call. May be NULL when len is zero. |
| len | U32; input length in bytes. |
| digest | U8 *; required caller-owned output buffer of at least 48 bytes. |
- Returns
- int: 0 on success; -1 on temporary allocation failure in a heap-based native build, or on argument/provider failure in the PSA consumer. Discard the digest on failure.
◆ SharkSslSha384Ctx_append()
append
- Parameters
-
| ctx | SharkSslSha384Ctx *; required initialized, unfinished context; updated in place. |
| data | const U8 *; input bytes, borrowed for this call. Supply a valid buffer when len is nonzero. |
| len | U32; input length in bytes, including zero. |
- Returns
- int: 0 on success. The native implementation returns 0 for valid inputs; the PSA consumer returns -1 for invalid state/arguments or a provider failure.
◆ SharkSslSha384Ctx_constructor()
Initialize.
Use caller-owned, correctly aligned context storage.
- Parameters
-
| ctx | Uninitialized data of size sizeof(SharkSslSha384Ctx). |
Finish or abort an active PSA hash before reinitializing that storage.
- Returns
- int: 0 on success. The native implementation returns 0 for valid inputs; the PSA consumer returns -1 for invalid state/arguments or a provider failure.
◆ SharkSslSha384Ctx_finish()
| int SharkSslSha384Ctx_finish |
( |
SharkSslSha384Ctx * |
ctx, |
|
|
U8 |
digest[SHARKSSL_SHA384_HASH_LEN] |
|
) |
| |
finish
- Parameters
-
| ctx | SharkSslSha384Ctx *; required initialized context; finalized by this call. Reinitialize before hashing another message. |
| digest | U8 *; required caller-owned output buffer of at least 48 bytes. |
- Returns
- int: 0 on success. The native implementation returns 0 for valid inputs; the PSA consumer returns -1 for invalid state/arguments or a provider failure.