abla/tls/pure/keysched

Generated from source.

Import with import "abla/tls/pure/keysched".

Source: abla/tls/pure/keysched/entry.ab

tlsWipe (fun)

trusted fun tlsWipe(secret: string): void

Overwrites secret's bytes with zeros: abla/crypto's cryptoWipeString, whose rule (a string whose buffer this code made, not read again) is written there.

tlsOwnedCopy (fun)

trusted fun tlsOwnedCopy(value: string): string

A copy of value in a buffer of its own (cryptoOwnedCopy), which tlsWipe may clear without touching value.

tlsHashLength (fun)

fun tlsHashLength(hash: int): int

The hash's output length in bytes (32 for SHA-256, 48 for SHA-384).

tlsHashOf (fun)

fun tlsHashOf(hash: int, data: string): string

The hash of data with the suite's hash.

tlsDeriveSecret (fun)

fun tlsDeriveSecret(hash: int, secret: string, label: string, transcriptHash: string): string

Derive-Secret(secret, label, transcript hash): label without the "tls13 " prefix.

tlsEarlySecret (fun)

fun tlsEarlySecret(hash: int, psk: string): string

The early secret: Extract with an all-zero salt over the pre-shared key, or over hash-length zeros when there is none (psk empty).

tlsHandshakeSecret (fun)

fun tlsHandshakeSecret(hash: int, earlySecret: string, sharedSecret: string): string

The handshake secret from the early secret and the (EC)DHE shared secret.

tlsMasterSecret (fun)

fun tlsMasterSecret(hash: int, handshakeSecret: string): string

The master secret from the handshake secret.

tlsTrafficKey (fun)

fun tlsTrafficKey(hash: int, trafficSecret: string, length: int): string

The traffic key of a traffic secret, length bytes (16 for AES-128-GCM, 32 for AES-256-GCM and ChaCha20-Poly1305).

tlsTrafficIv (fun)

fun tlsTrafficIv(hash: int, trafficSecret: string): string

The traffic IV of a traffic secret: 12 bytes.

tlsNextTrafficSecret (fun)

fun tlsNextTrafficSecret(hash: int, trafficSecret: string): string

The next application traffic secret of a KeyUpdate (section 7.2).

tlsFinishedKey (fun)

fun tlsFinishedKey(hash: int, baseKey: string): string

The finished_key of a handshake traffic secret (section 4.4.4).

tlsFinishedVerifyData (fun)

fun tlsFinishedVerifyData(hash: int, baseKey: string, transcriptHash: string): string

verify_data = HMAC(finished_key, Transcript-Hash(messages up to the Finished)).

TlsHandshakeSecrets (class)

class TlsHandshakeSecrets(val handshakeSecret: string, val clientTraffic: string, val serverTraffic: string)

Everything derived from the handshake secret once the ServerHello is hashed: the two handshake traffic secrets. helloHash is the transcript hash through the ServerHello.

tlsDeriveHandshakeSecrets (fun)

fun tlsDeriveHandshakeSecrets(hash: int, earlySecret: string, sharedSecret: string,
    helloHash: string): TlsHandshakeSecrets

Returns the TLS 1.3 handshake secret and both handshake traffic secrets using the ServerHello transcript hash.

TlsApplicationSecrets (class)

class TlsApplicationSecrets(val masterSecret: string, val clientTraffic: string, val serverTraffic: string,
    val exporter: string)

The application traffic secrets, the exporter master secret, and (later, once the client Finished is hashed) the resumption master secret. serverFinishedHash is the transcript hash through the server Finished.

tlsDeriveApplicationSecrets (fun)

fun tlsDeriveApplicationSecrets(hash: int, handshakeSecret: string,
    serverFinishedHash: string): TlsApplicationSecrets

Returns the TLS 1.3 master, application traffic and exporter secrets using the server Finished transcript hash.

tlsResumptionMasterSecret (fun)

fun tlsResumptionMasterSecret(hash: int, masterSecret: string, clientFinishedHash: string): string

The resumption master secret; clientFinishedHash is the transcript hash through the client Finished.

TlsTranscript (class)

class TlsTranscript(var messages: string)

The transcript: the handshake messages (each with its 4-byte header) so far, in order. The hash is taken at the points the key schedule names, over everything added until then.

tlsTranscript (fun)

fun tlsTranscript(): TlsTranscript

Returns an empty TLS handshake transcript.

TlsTranscript.add (extension fun)

fun TlsTranscript.add(message: string): void

Appends one complete handshake message, including its header, to the transcript.

TlsTranscript.hash (extension fun)

fun TlsTranscript.hash(hash: int): string

Returns the SHA-384 or SHA-256 digest of the handshake bytes appended so far.

tlsResumptionPsk (fun)

fun tlsResumptionPsk(hash: int, resumptionMasterSecret: string, nonce: string): string

The PSK of a ticket: HKDF-Expand-Label(resumption_master_secret, "resumption", ticket_nonce, Hash.length).

tlsBinderValue (fun)

fun tlsBinderValue(hash: int, psk: string, partialTranscript: string): string

The binder for the PSK psk over partialTranscript: the bytes the binder covers, that is the transcript so far (empty for a first ClientHello; the message_hash, the HelloRetryRequest for a second) followed by the partial ClientHello. HMAC(finished_key of the "res binder" secret of the early secret, Hash(that)).

tlsExporterValue (fun)

fun tlsExporterValue(hash: int, exporterSecret: string, label: string, context: string, length: int): string

TLS-Exporter(label, context, length) of RFC 8446 section 7.5 over an exporter master secret.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.