TLS 1.3 transcript-hash helpers. More...
Go to the source code of this file.
Functions | |
| QSC_EXPORT_API qsc_tls_status | qsc_tls_transcript_initialize (qsc_tls_transcript_state *state, qsc_tls_hash_algorithm hash) |
| Initialize a transcript hash state. | |
| QSC_EXPORT_API void | qsc_tls_transcript_dispose (qsc_tls_transcript_state *state) |
| Dispose of a transcript hash state. | |
| QSC_EXPORT_API qsc_tls_status | qsc_tls_transcript_update (qsc_tls_transcript_state *state, const uint8_t *input, size_t inplen) |
| Append serialized handshake bytes to the transcript hash. | |
| QSC_EXPORT_API qsc_tls_status | qsc_tls_transcript_snapshot (const qsc_tls_transcript_state *state, uint8_t *output, size_t outlen, size_t *written) |
| Snapshot the current transcript digest without disturbing the ongoing hash state. | |
| QSC_EXPORT_API qsc_tls_status | qsc_tls_transcript_replace_with_message_hash (qsc_tls_transcript_state *state) |
| Replace the transcript with the synthetic message_hash form used after HelloRetryRequest. | |
| QSC_EXPORT_API size_t | qsc_tls_transcript_digest_size (qsc_tls_hash_algorithm hash) |
| Get the digest size in bytes for a TLS transcript hash algorithm. | |
TLS 1.3 transcript-hash helpers.
This header exposes the transcript hashing helpers used by the TLS 1.3 handshake layer. The transcript state stores an incremental hash context selected by the negotiated cipher suite hash. Callers update the transcript with serialized handshake bytes and may request digest snapshots without disturbing the active hash state.
| QSC_EXPORT_API size_t qsc_tls_transcript_digest_size | ( | qsc_tls_hash_algorithm | hash | ) |
Get the digest size in bytes for a TLS transcript hash algorithm.
| hash | [enum] The transcript hash algorithm. |
| QSC_EXPORT_API void qsc_tls_transcript_dispose | ( | qsc_tls_transcript_state * | state | ) |
Dispose of a transcript hash state.
Securely erases the active transcript state and any retained intermediate hash context.
| state | [struct*] The transcript state to clear. |
| QSC_EXPORT_API qsc_tls_status qsc_tls_transcript_initialize | ( | qsc_tls_transcript_state * | state, |
| qsc_tls_hash_algorithm | hash ) |
Initialize a transcript hash state.
| state | [struct*] The transcript state to initialize. |
| hash | [enum] The hash algorithm to activate. |
| QSC_EXPORT_API qsc_tls_status qsc_tls_transcript_replace_with_message_hash | ( | qsc_tls_transcript_state * | state | ) |
Replace the transcript with the synthetic message_hash form used after HelloRetryRequest.
Replaces the current transcript contents with the synthetic handshake message defined by RFC 8446 Section 4.4.1, consisting of the message_hash handshake type and the digest of the previous ClientHello.
| state | [struct*] The active transcript state. |
| QSC_EXPORT_API qsc_tls_status qsc_tls_transcript_snapshot | ( | const qsc_tls_transcript_state * | state, |
| uint8_t * | output, | ||
| size_t | outlen, | ||
| size_t * | written ) |
Snapshot the current transcript digest without disturbing the ongoing hash state.
Clones the underlying hash context, finalizes the clone into the caller-supplied output buffer, and leaves the live transcript state unchanged.
| state | [const struct*] The active transcript state. |
| output | [uint8_t*] The destination buffer for the transcript digest. |
| outlen | [size_t] The destination buffer length in bytes. |
| written | [size_t*] Receives the number of digest bytes written. |
| QSC_EXPORT_API qsc_tls_status qsc_tls_transcript_update | ( | qsc_tls_transcript_state * | state, |
| const uint8_t * | input, | ||
| size_t | inplen ) |
Append serialized handshake bytes to the transcript hash.
| state | [struct*] The active transcript state. |
| input | [const uint8_t*] The serialized handshake bytes to append. |
| inplen | [size_t] The number of bytes to append. |