Skip to content
Systems programming for what’s next.
— Vex

std::tls API Reference ​

Development snapshot. Generated from the current repository source. This inventory may include internal and test declarations; it is not a list of supported public APIs. Check the module guide and the compiler version you use before relying on an entry.

Application entry points ​

Read the TLS protocol-owner guide for record state, explicit certificate trust and the client-handshake sequence. This inventory does not provide a connected TlsStream; raw codecs and test fixtures do not establish network interoperability.

Overview ​

Structs: TlsAlert · TlsHandshakeFeedResult · TlsHandshakeAssembler · TlsCertificateEntryView · TlsCertificateMessageView · TlsCertificateVerifyView · TlsTrafficKeyLengths · TlsWireSlice · TlsHelloExtensions · TlsExtensionEntry · TlsKeyShareEntry · TlsClientHelloView · TlsServerHelloView · TlsDnsIdentityError · TlsDnsIdentity · TlsSecretSchedule · TlsX25519Negotiation · TlsEncryptedExtensionsCandidate · TlsRecordHeader · TlsPlaintext · TlsCipherState · TlsHandshakeHeader · TlsTranscript · TlsTransportEvent · TlsTransportError · TlsApplicationTraffic · TlsNextTrafficGeneration · X509Error · X509CertificateView · X509ExtensionView · X509ExtensionPolicy · X509TlsServerVerifier

Enums: TlsAlertLevel · TlsAlertDescription · TlsAlertError · TlsHandshakeAssemblerError · TlsHandshakeFeedKind · TlsCertificateError · TlsKeyScheduleError · TlsHashAlgorithm · TlsHelloError · TlsDnsIdentityErrorKind · TlsSecretStage · TlsKeyUpdateRequest · TlsKeyUpdateError · TlsHandshakeRole · TlsX25519NegotiationStage · TlsX25519NegotiationError · TlsRecordError · TlsTranscriptError · TlsTransportState · TlsTransportEventKind · TlsTransportErrorKind · X509ErrorKind

Functions: alertLevelCode · decodeAlertLevel · alertDescriptionCode · decodeAlertDescription · canonicalAlertLevel · encodeTlsAlert · decodeTlsAlert · emptyFeedResult · completeFeedResult · copyBytes · spansOverlap · headerFromArray · validateOutput · headerFromSpan · certificateU16 · certificateU24 · certificateSlice · scanCertificateEntryExtensions · certificateEntryAtChecked · decodeServerCertificate · decodeCertificateVerify · verifyServerCertificateSignature · verifyServerCertificateSignatureWithKey · spansOverlap · hkdfExpandLabel · deriveSecret · computeFinishedVerifyData · verifyFinished · deriveTrafficKeys · updateTrafficSecret · emptyWireSlice · emptyExtensions · readU16 · writeU16 · copyBytes · rangesOverlap · spanRangeOverlapsOutput · validateVector16 · validateSupportedVersions · validateServerName · validateAlpn · validateCookie · validatePadding · validateClientPsk · groupsContain · validateClientKeyShares · validateServerKeyShare · scanExtensions · decodeExactHeader · copyRandom · isHelloRetryRandom · decodeClientHello · decodeServerHello · encodeHeader · encodeTlsExtension · encodeCookie · encodeClientHello · encodeServerHello · encodeClientSupportedVersions · encodeServerSupportedVersion · encodeU16VectorExtension · encodeSupportedGroups · encodeSignatureAlgorithms · encodeClientKeyShare · encodeServerKeyShare · encodeHelloRetryKeyShare · identityError · identityByteAt · isAsciiAlpha · isAsciiDigit · foldedAscii · normalizedDnsLength · isIpv4Reference · equalDnsRange · sameHash · rangesOverlap · exactArraySpan · exactArraySpanMut · emptyTranscriptHash · transcriptDigest · extractSecret · validateDualOutput · computeFinishedFromTranscript · verifyFinishedFromTranscript · keyUpdateRequestCode · encodeTlsKeyUpdate · decodeTlsKeyUpdate · exactArraySpan · exactArraySpanMut · spansOverlap · equalBytes · mapHelloFailure · mapTranscriptFailure · mapScheduleFailure · cipherHash · offeredCipher · offeredSignature · hashU16 · retryInvariantDigest · extensionPresent · validateTrafficOutputs · negotiationU16 · encodeRecordHeaderRaw · decodeRecordHeaderRaw · encodeRecordHeader · decodeRecordHeader · isTlsInnerContentType · rangesOverlap · constructNonce · decodeHeaderRaw · encodeHeaderRaw · decodeHandshakeHeader · encodeHandshakeHeader · sameHash · transportError · transportRecordError · transportAlertError · transportScheduleError · transportKeyUpdateError · recordFailureEndsConnection · arraySpan · mutableArraySpan · stageNextGeneration · x509Error · bytesOf · rebaseSlice · rebaseElement · child · childCount · isEd25519Algorithm · explicitElement · x509Digit · x509TwoDigits · x509LeapYear · x509DaysInMonth · x509DaysFromCivil · parseCertificateTime · extensionSequence · extensionAt · oidMatches · boundedPathLength · sameOid · parseBasicConstraints · parseKeyUsage · parseExtendedKeyUsage · extensionPolicy · namesEqual · subjectNameIsEmpty · validateLeafPolicy · validateAuthorityPolicy · certificateIsSelfIssued · subjectAltNames · arraySpan · mutableArraySpan · test_tls_alert_canonical_roundtrip · test_tls_alert_rejects_noncanonical_emission · test_tls_alert_decode_is_exact_and_downgrade_safe · arraySpan · mutableArraySpan · spansEqual · test_tls_handshake_assembler_direct_and_coalesced_zero_copy · test_tls_handshake_assembler_every_two_fragment_split · test_tls_handshake_assembler_one_byte_fragments · test_tls_handshake_assembler_rejections_are_atomic · test_tls_handshake_assembler_output_identity_and_boundaries · test_tls_handshake_assembler_zero_body_and_invalid_inputs · arraySpan · u16ArraySpan · state · decrypt_record_seq_zero · benchRecordDecrypt · bench_tls_record_decrypt_chacha20_10kb · bench_tls_record_decrypt_chacha20_16kb · bench_tls_record_decrypt_aes128_gcm_16kb · bench_tls_derive_traffic_keys_sha256 · bench_tls_derive_traffic_keys_sha384 · appendSelectedTranscript · appendDualTranscript · bench_tls_transcript_selected_sha256_1kb · bench_tls_transcript_dual_hash_1kb · deriveHandshakeScheduleSha256 · bench_tls_handshake_schedule_sha256 · bench_tls_finished_sha256 · buildClientHelloBenchmark · decodeClientHelloBench · bench_tls_client_hello_decode · bench_tls_handshake_assembler_direct · bench_tls_handshake_assembler_fragmented_1kb · arraySpan · mutableArraySpan · test_tls_hkdf_expand_label_sha256_vector · test_tls_hkdf_expand_label_sha384_vector · test_tls_hkdf_expand_label_rejects_invalid_lengths_and_aliasing · test_tls_traffic_key_schedule_validates_suite_and_outputs · helloErrorName · arraySpan · mutableArraySpan · appendClientExtensions · appendServerExtensions · test_tls_client_hello_codec_roundtrip_and_views · test_tls_server_hello_codec_roundtrip · test_tls_client_hello_duplicate_and_order_rejections · test_tls_hello_lengths_and_aliasing_fail_before_mutation · test_tls_hello_retry_request_and_group_coherence · test_tls_hello_cookie_and_padding_are_exact · test_tls_client_hello_rejects_every_truncated_prefix · bytes · matches · test_tls_dns_identity_exact_ascii · test_tls_dns_identity_wildcard_is_one_complete_label · test_tls_dns_identity_rejects_malformed_and_ip_refs · arraySpan · mutableArraySpan · assertPrefix · test_tls_rfc8448_handshake_traffic_secrets · test_tls_secret_schedule_orders_transitions_and_finished · test_tls_sha384_schedule_and_finished_validation · test_tls_secret_schedule_retire_is_irreversible · arraySpan · mutableArraySpan · strBytes · traffic · cipher · test_tls_key_update_codec_and_independent_schedule_vector · test_tls_key_update_switches_generation_after_old_key_record · test_tls_requested_key_update_orders_response_before_data · test_tls_key_update_capacity_failure_is_atomic · test_tls_fragmented_key_update_commits_only_after_last_fragment · test_tls_new_generation_is_rejected_before_key_update_record · test_tls_crossed_requested_key_updates_advance_two_generations · arraySpan · mutableArraySpan · samePrefix · appendClientExtensions · appendClientExtensionsWithoutKeyShare · appendRetryClientExtensions · buildClientHello · buildClientHelloWithoutKeyShare · buildRetryClientHello · buildServerHello · newOwner · test_tls_x25519_negotiation_matches_both_roles_sha256 · test_tls_x25519_negotiation_sha384_and_single_use · test_tls_x25519_negotiation_rejects_low_order_before_commit · test_tls_x25519_negotiation_hrr_cookie_only_replay · test_tls_x25519_negotiation_hrr_cookie_limit_is_transactional · test_tls_x25519_negotiation_hrr_commits_fresh_client_hello · test_tls_x25519_negotiation_preconditions_fail_closed · bytes · words · bytesMut · buildClient · buildServer · appendClientCapabilities · buildRetryClient · buildHelloRetry · negotiateClient · negotiateRetryClient · bench_tls_x25519_full_client_negotiation_sha256 · bench_tls_x25519_hrr_client_negotiation_sha256 · arraySpan · mutableArraySpan · strBytes · aes128State · cipherState · encryptFailedWith · decryptFailedWith · test_tls_record_header_encoding_and_bounds · test_tls_record_encrypt_decrypt_roundtrip · test_tls_record_rejects_truncated_and_malformed_headers · test_tls_record_auth_failure_zeroes_plaintext_and_preserves_sequence · test_tls_record_rejects_invalid_key_buffer_and_oversize · test_tls_record_empty_plaintext_is_not_an_error · test_tls_record_rejects_overlapping_decrypt_output · test_tls_record_owns_key_material_and_supports_all_record_ciphers · test_tls_record_rejects_encrypt_alias_and_short_decrypt_output · arraySpan · mutableArraySpan · assertBytes · test_tls_handshake_header_codec_is_exact_and_bounded · test_tls_transcript_sha256_streaming_snapshot · test_tls_transcript_sha384_matches_independent_vector · test_tls_transcript_rejections_are_atomic · test_tls_transcript_hello_retry_rewrite_sha256 · test_tls_transcript_hello_retry_rewrite_sha384 · test_tls_transcript_constructor_and_output_fail_closed · test_tls_transcript_tracks_both_hashes_until_selection · arraySpan · mutableArraySpan · strBytes · traffic · peerCipher · test_tls_transport_application_roundtrip · test_tls_transport_close_notify_is_half_close_then_closed · test_tls_transport_capacity_failure_is_retryable · test_tls_transport_local_user_canceled_orders_shutdown · test_tls_transport_fatal_alert_retires_both_peers · test_tls_transport_wire_failure_poisoning_is_contextual · test_tls_transport_user_canceled_requires_close_notify · test_tls_transport_authenticated_control_messages_fail_closed · certSpan · stringBytes · x509ArrayBytes · x509MutableArrayBytes · x509WriteU16 · x509WriteU24 · buildAuthenticatedClientHelloWithAlpn · buildAuthenticatedClientHello · buildAuthenticatedServerHello · buildServerCertificateChainMessage · buildAuthenticatedCertificateVerify · buildAuthenticatedFinished · buildServerCertificateMessage · certificateInputs · test_x509_ed25519_view_signature_and_san · test_x509_rejects_tamper_and_unsupported_algorithm · test_x509_requires_exact_der · test_x509_direct_tls_server_policy · test_x509_direct_policy_time_signature_and_critical_extension · test_x509_bounded_intermediate_chain_and_path_length · test_tls_server_certificate_view_and_exact_framing · test_tls_ed25519_server_certificate_verify_context · test_tls_certificate_verify_exact_lengths · test_tls_authentication_wire_builders · test_tls_authenticated_owner_full_flight · runAuthenticatedClientFlight · bench_tls_authenticated_client_full_flight · bench_x509_ed25519_leaf_parse · bench_x509_ed25519_direct_tls_policy · bench_x509_ed25519_one_intermediate_policy · bench_tls_ed25519_server_certificate_verify

Constants: TLS_ALERT_WIRE_BYTES · TLS_SIGNATURE_ED25519 · TLS_MAX_CERTIFICATE_ENTRIES · TLS_MAX_CERTIFICATE_ENTRY_EXTENSIONS · HANDSHAKE_TYPE_CLIENT_HELLO · HANDSHAKE_TYPE_SERVER_HELLO · HANDSHAKE_TYPE_ENCRYPTED_EXTENSIONS · HANDSHAKE_TYPE_CERTIFICATE · HANDSHAKE_TYPE_CERTIFICATE_VERIFY · HANDSHAKE_TYPE_FINISHED · HANDSHAKE_TYPE_KEY_UPDATE · TLS_LEGACY_VERSION · TLS_EXTENSION_SERVER_NAME · TLS_EXTENSION_SUPPORTED_GROUPS · TLS_EXTENSION_SIGNATURE_ALGORITHMS · TLS_EXTENSION_ALPN · TLS_EXTENSION_PADDING · TLS_EXTENSION_PRE_SHARED_KEY · TLS_EXTENSION_EARLY_DATA · TLS_EXTENSION_SUPPORTED_VERSIONS · TLS_EXTENSION_COOKIE · TLS_EXTENSION_PSK_KEY_EXCHANGE_MODES · TLS_EXTENSION_KEY_SHARE · TLS_NAMED_GROUP_X25519 · TLS_MAX_HELLO_EXTENSIONS · TLS_MAX_HELLO_CIPHER_SUITES · TLS_MAX_HELLO_GROUPS · TLS_MAX_HELLO_SIGNATURE_SCHEMES · TLS_HELLO_RETRY_RANDOM · TLS_KEY_UPDATE_WIRE_BYTES · TLS_MAX_NEGOTIATION_ALPN_BYTES · TLS_MAX_SELECTED_ALPN_BYTES · TLS_MAX_RETRY_COOKIE_BYTES · CONTENT_TYPE_CHANGE_CIPHER_SPEC · CONTENT_TYPE_ALERT · CONTENT_TYPE_HANDSHAKE · CONTENT_TYPE_APPLICATION_DATA · TLS_VERSION_1_2 · TLS_VERSION_1_3 · CIPHER_AES_128_GCM_SHA256 · CIPHER_AES_256_GCM_SHA384 · CIPHER_CHACHA20_POLY1305_SHA256 · TLS_RECORD_HEADER_LEN · TLS_AEAD_TAG_LEN · TLS_MAX_PLAINTEXT_LEN · TLS_MAX_CIPHERTEXT_LEN · TLS_HANDSHAKE_HEADER_LEN · TLS_MAX_HANDSHAKE_BODY_LEN · TLS_DEFAULT_TRANSCRIPT_LIMIT · TLS_MAX_TRANSCRIPT_LIMIT · HANDSHAKE_TYPE_MESSAGE_HASH · TLS_MIN_PROTECTED_RECORD_BYTES · OID_ED25519 · OID_SUBJECT_ALT_NAME · OID_BASIC_CONSTRAINTS · OID_KEY_USAGE · OID_EXTENDED_KEY_USAGE · OID_SUBJECT_KEY_IDENTIFIER · OID_AUTHORITY_KEY_IDENTIFIER · OID_NAME_CONSTRAINTS · OID_POLICY_MAPPINGS · OID_POLICY_CONSTRAINTS · OID_INHIBIT_ANY_POLICY · OID_SERVER_AUTH · OID_ANY_EXTENDED_KEY_USAGE · X509_MAX_INTERMEDIATES · ED25519_LEAF_HEX · ED25519_CHAIN_ROOT_HEX · ED25519_CHAIN_INTERMEDIATE_HEX · ED25519_CHAIN_LEAF_HEX · ED25519_CERTIFICATE_VERIFY_HEX · CERTIFICATE_CLIENT_HELLO · ED25519_CHAIN_LEAF_PRIVATE · ED25519_CERT

Constants ​

TLS_ALERT_WIRE_BYTES 🔓 export ​

📄 alert.vx L5-5

vex
export const TLS_ALERT_WIRE_BYTES: usize=2 as usize;

TLS_SIGNATURE_ED25519 🔓 export ​

📄 certificate.vx L13-13

vex
export const TLS_SIGNATURE_ED25519: u16=0x0807 as u16;

TLS_MAX_CERTIFICATE_ENTRIES 🔓 export ​

📄 certificate.vx L14-14

vex
export const TLS_MAX_CERTIFICATE_ENTRIES: usize=9 as usize;

TLS_MAX_CERTIFICATE_ENTRY_EXTENSIONS 🔓 export ​

📄 certificate.vx L15-15

vex
export const TLS_MAX_CERTIFICATE_ENTRY_EXTENSIONS: usize=32 as usize;

HANDSHAKE_TYPE_CLIENT_HELLO 🔓 export ​

📄 handshake.vx L13-13

vex
export const HANDSHAKE_TYPE_CLIENT_HELLO: u8=1;

HANDSHAKE_TYPE_SERVER_HELLO 🔓 export ​

📄 handshake.vx L14-14

vex
export const HANDSHAKE_TYPE_SERVER_HELLO: u8=2;

HANDSHAKE_TYPE_ENCRYPTED_EXTENSIONS 🔓 export ​

📄 handshake.vx L15-15

vex
export const HANDSHAKE_TYPE_ENCRYPTED_EXTENSIONS: u8=8;

HANDSHAKE_TYPE_CERTIFICATE 🔓 export ​

📄 handshake.vx L16-16

vex
export const HANDSHAKE_TYPE_CERTIFICATE: u8=11;

HANDSHAKE_TYPE_CERTIFICATE_VERIFY 🔓 export ​

📄 handshake.vx L17-17

vex
export const HANDSHAKE_TYPE_CERTIFICATE_VERIFY: u8=15;

HANDSHAKE_TYPE_FINISHED 🔓 export ​

📄 handshake.vx L18-18

vex
export const HANDSHAKE_TYPE_FINISHED: u8=20;

HANDSHAKE_TYPE_KEY_UPDATE 🔓 export ​

📄 handshake.vx L19-19

vex
export const HANDSHAKE_TYPE_KEY_UPDATE: u8=24;

TLS_LEGACY_VERSION 🔓 export ​

📄 hello.vx L14-14

vex
export const TLS_LEGACY_VERSION: u16=0x0303 as u16;

TLS_EXTENSION_SERVER_NAME 🔓 export ​

📄 hello.vx L16-16

vex
export const TLS_EXTENSION_SERVER_NAME: u16=0 as u16;

TLS_EXTENSION_SUPPORTED_GROUPS 🔓 export ​

📄 hello.vx L17-17

vex
export const TLS_EXTENSION_SUPPORTED_GROUPS: u16=10 as u16;

TLS_EXTENSION_SIGNATURE_ALGORITHMS 🔓 export ​

📄 hello.vx L18-18

vex
export const TLS_EXTENSION_SIGNATURE_ALGORITHMS: u16=13 as u16;

TLS_EXTENSION_ALPN 🔓 export ​

📄 hello.vx L19-19

vex
export const TLS_EXTENSION_ALPN: u16=16 as u16;

TLS_EXTENSION_PADDING 🔓 export ​

📄 hello.vx L20-20

vex
export const TLS_EXTENSION_PADDING: u16=21 as u16;

TLS_EXTENSION_PRE_SHARED_KEY 🔓 export ​

📄 hello.vx L21-21

vex
export const TLS_EXTENSION_PRE_SHARED_KEY: u16=41 as u16;

TLS_EXTENSION_EARLY_DATA 🔓 export ​

📄 hello.vx L22-22

vex
export const TLS_EXTENSION_EARLY_DATA: u16=42 as u16;

TLS_EXTENSION_SUPPORTED_VERSIONS 🔓 export ​

📄 hello.vx L23-23

vex
export const TLS_EXTENSION_SUPPORTED_VERSIONS: u16=43 as u16;

📄 hello.vx L24-24

vex
export const TLS_EXTENSION_COOKIE: u16=44 as u16;

TLS_EXTENSION_PSK_KEY_EXCHANGE_MODES 🔓 export ​

📄 hello.vx L25-25

vex
export const TLS_EXTENSION_PSK_KEY_EXCHANGE_MODES: u16=45 as u16;

TLS_EXTENSION_KEY_SHARE 🔓 export ​

📄 hello.vx L26-26

vex
export const TLS_EXTENSION_KEY_SHARE: u16=51 as u16;

TLS_NAMED_GROUP_X25519 🔓 export ​

📄 hello.vx L28-28

vex
export const TLS_NAMED_GROUP_X25519: u16=29 as u16;

TLS_MAX_HELLO_EXTENSIONS 🔓 export ​

📄 hello.vx L29-29

vex
export const TLS_MAX_HELLO_EXTENSIONS: usize=64 as usize;

TLS_MAX_HELLO_CIPHER_SUITES 🔓 export ​

📄 hello.vx L30-30

vex
export const TLS_MAX_HELLO_CIPHER_SUITES: usize=256 as usize;

TLS_MAX_HELLO_GROUPS 🔓 export ​

📄 hello.vx L31-31

vex
export const TLS_MAX_HELLO_GROUPS: usize=64 as usize;

TLS_MAX_HELLO_SIGNATURE_SCHEMES 🔓 export ​

📄 hello.vx L32-32

vex
export const TLS_MAX_HELLO_SIGNATURE_SCHEMES: usize=64 as usize;

TLS_HELLO_RETRY_RANDOM ​

📄 hello.vx L34-39

vex
const TLS_HELLO_RETRY_RANDOM: [u8; 32]=[
    0xcfu8, 0x21, 0xad, 0x74, 0xe5, 0x9a, 0x61, 0x11,
    0xbe, 0x1d, 0x8c, 0x02, 0x1e, 0x65, 0xb8, 0x91,
    0xc2, 0xa2, 0x11, 0x16, 0x7a, 0xbb, 0x8c, 0x5e,
    0x07, 0x9e, 0x09, 0xe2, 0xc8, 0xa8, 0x33, 0x9c,
];

TLS_KEY_UPDATE_WIRE_BYTES 🔓 export ​

📄 key_update.vx L7-7

vex
export const TLS_KEY_UPDATE_WIRE_BYTES: usize=5 as usize;

TLS_MAX_NEGOTIATION_ALPN_BYTES 🔓 export ​

📄 negotiation.vx L36-36

vex
export const TLS_MAX_NEGOTIATION_ALPN_BYTES: usize=1024 as usize;

TLS_MAX_SELECTED_ALPN_BYTES 🔓 export ​

📄 negotiation.vx L37-37

vex
export const TLS_MAX_SELECTED_ALPN_BYTES: usize=255 as usize;

📄 negotiation.vx L38-38

vex
export const TLS_MAX_RETRY_COOKIE_BYTES: usize=4096 as usize;

CONTENT_TYPE_CHANGE_CIPHER_SPEC 🔓 export ​

📄 record.vx L11-11

vex
export const CONTENT_TYPE_CHANGE_CIPHER_SPEC: u8=20;

CONTENT_TYPE_ALERT 🔓 export ​

📄 record.vx L12-12

vex
export const CONTENT_TYPE_ALERT: u8=21;

CONTENT_TYPE_HANDSHAKE 🔓 export ​

📄 record.vx L13-13

vex
export const CONTENT_TYPE_HANDSHAKE: u8=22;

CONTENT_TYPE_APPLICATION_DATA 🔓 export ​

📄 record.vx L14-14

vex
export const CONTENT_TYPE_APPLICATION_DATA: u8=23;

TLS_VERSION_1_2 🔓 export ​

📄 record.vx L16-16

vex
export const TLS_VERSION_1_2: u16=0x0303;

TLS_VERSION_1_3 🔓 export ​

📄 record.vx L17-17

vex
export const TLS_VERSION_1_3: u16=0x0304;

CIPHER_AES_128_GCM_SHA256 🔓 export ​

📄 record.vx L19-19

vex
export const CIPHER_AES_128_GCM_SHA256: u16=0x1301;

CIPHER_AES_256_GCM_SHA384 🔓 export ​

📄 record.vx L20-20

vex
export const CIPHER_AES_256_GCM_SHA384: u16=0x1302;

CIPHER_CHACHA20_POLY1305_SHA256 🔓 export ​

📄 record.vx L21-21

vex
export const CIPHER_CHACHA20_POLY1305_SHA256: u16=0x1303;

TLS_RECORD_HEADER_LEN ​

📄 record.vx L23-23

vex
const TLS_RECORD_HEADER_LEN: u64=5;

TLS_AEAD_TAG_LEN ​

📄 record.vx L24-24

vex
const TLS_AEAD_TAG_LEN: u64=16;

TLS_MAX_PLAINTEXT_LEN ​

📄 record.vx L25-25

vex
const TLS_MAX_PLAINTEXT_LEN: u64=16384;

TLS_MAX_CIPHERTEXT_LEN ​

📄 record.vx L26-26

vex
const TLS_MAX_CIPHERTEXT_LEN: u64=16640;

TLS_HANDSHAKE_HEADER_LEN 🔓 export ​

📄 transcript.vx L10-10

vex
export const TLS_HANDSHAKE_HEADER_LEN: usize=4 as usize;

TLS_MAX_HANDSHAKE_BODY_LEN 🔓 export ​

📄 transcript.vx L11-11

vex
export const TLS_MAX_HANDSHAKE_BODY_LEN: usize=0x00ff_ffff as usize;

TLS_DEFAULT_TRANSCRIPT_LIMIT 🔓 export ​

📄 transcript.vx L12-12

vex
export const TLS_DEFAULT_TRANSCRIPT_LIMIT: usize=16 as usize * 1024 as usize * 1024 as usize;

TLS_MAX_TRANSCRIPT_LIMIT 🔓 export ​

📄 transcript.vx L13-13

vex
export const TLS_MAX_TRANSCRIPT_LIMIT: usize=64 as usize * 1024 as usize * 1024 as usize;

HANDSHAKE_TYPE_MESSAGE_HASH 🔓 export ​

📄 transcript.vx L14-14

vex
export const HANDSHAKE_TYPE_MESSAGE_HASH: u8=254 as u8;

TLS_MIN_PROTECTED_RECORD_BYTES ​

📄 transport.vx L23-23

vex
const TLS_MIN_PROTECTED_RECORD_BYTES: usize=22 as usize;

OID_ED25519 ​

📄 x509.vx L9-9

vex
const OID_ED25519: [u8; 3]=[0x2bu8, 0x65, 0x70];

OID_SUBJECT_ALT_NAME ​

📄 x509.vx L10-10

vex
const OID_SUBJECT_ALT_NAME: [u8; 3]=[0x55u8, 0x1d, 0x11];

OID_BASIC_CONSTRAINTS ​

📄 x509.vx L11-11

vex
const OID_BASIC_CONSTRAINTS: [u8; 3]=[0x55u8, 0x1d, 0x13];

OID_KEY_USAGE ​

📄 x509.vx L12-12

vex
const OID_KEY_USAGE: [u8; 3]=[0x55u8, 0x1d, 0x0f];

OID_EXTENDED_KEY_USAGE ​

📄 x509.vx L13-13

vex
const OID_EXTENDED_KEY_USAGE: [u8; 3]=[0x55u8, 0x1d, 0x25];

OID_SUBJECT_KEY_IDENTIFIER ​

📄 x509.vx L14-14

vex
const OID_SUBJECT_KEY_IDENTIFIER: [u8; 3]=[0x55u8, 0x1d, 0x0e];

OID_AUTHORITY_KEY_IDENTIFIER ​

📄 x509.vx L15-15

vex
const OID_AUTHORITY_KEY_IDENTIFIER: [u8; 3]=[0x55u8, 0x1d, 0x23];

OID_NAME_CONSTRAINTS ​

📄 x509.vx L16-16

vex
const OID_NAME_CONSTRAINTS: [u8; 3]=[0x55u8, 0x1d, 0x1e];

OID_POLICY_MAPPINGS ​

📄 x509.vx L17-17

vex
const OID_POLICY_MAPPINGS: [u8; 3]=[0x55u8, 0x1d, 0x21];

OID_POLICY_CONSTRAINTS ​

📄 x509.vx L18-18

vex
const OID_POLICY_CONSTRAINTS: [u8; 3]=[0x55u8, 0x1d, 0x24];

OID_INHIBIT_ANY_POLICY ​

📄 x509.vx L19-19

vex
const OID_INHIBIT_ANY_POLICY: [u8; 3]=[0x55u8, 0x1d, 0x36];

OID_SERVER_AUTH ​

📄 x509.vx L20-20

vex
const OID_SERVER_AUTH: [u8; 8]=[0x2bu8, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01];

OID_ANY_EXTENDED_KEY_USAGE ​

📄 x509.vx L21-21

vex
const OID_ANY_EXTENDED_KEY_USAGE: [u8; 4]=[0x55u8, 0x1d, 0x25, 0x00];

X509_MAX_INTERMEDIATES 🔓 export ​

📄 x509.vx L23-23

vex
export const X509_MAX_INTERMEDIATES: usize=8 as usize;

ED25519_LEAF_HEX ​

📄 x509.test.vx L17-17

vex
const ED25519_LEAF_HEX: str="308201aa3082015ca00302010202141f0fea496120e0120c99cd65a49cccf87a1bb12d300506032b657030233121301f06035504030c186d7573742d6e6f742d62652d757365642e6578616d706c65301e170d3236303832303038303232335a170d3236303930393038303232335a301f311d301b06035504030c1469676e6f7265642d6c6561662e6578616d706c65302a300506032b65700321005e5117cb2ea6414a2928cb270d0cdee40d6ee46e9c9678a8e6c1b3348307f6c4a381a53081a2302d0603551d1104263024820f6170692e6578616d706c652e636f6d82112a2e736572766963652e6578616d706c65300c0603551d130101ff04023000300e0603551d0f0101ff04040302078030130603551d25040c300a06082b06010505070301301d0603551d0e041604140396d09772dd57912241485b237c839c6cd21123301f0603551d23041830168014ac8d629f5d979f1217e9cecf4c4e38554308cddb300506032b6570034100bdeacf260c5a0838922a192464d4ed989fe983ddc4fcf0be602f5545f4958030b0db437c3fa6db5ed80b8f535b734df4d35b9dde3e389488d9080e0917fea202";

ED25519_CHAIN_ROOT_HEX ​

📄 x509.test.vx L19-19

vex
const ED25519_CHAIN_ROOT_HEX: str="308201583082010aa003020102021467b7cb78aec3c2cd50dc98094933c80ba70a600c300506032b657030183116301406035504030c0d5665782d546573742d526f6f74301e170d3236303832303038323030335a170d3236313131383038323030335a30183116301406035504030c0d5665782d546573742d526f6f74302a300506032b6570032100d23032626c497f4d0b0efeb047bc68f60a23947b8ead48cd0faea9f67af00372a3663064301d0603551d0e04160414f16d89be0b56cd120e817ec1367aa0ea44001f85301f0603551d23041830168014f16d89be0b56cd120e817ec1367aa0ea44001f8530120603551d130101ff040830060101ff020101300e0603551d0f0101ff040403020106300506032b657003410088e79915d26d25724e845c4f476c4f3ef8b20ac5b1fb688e936501ac8778bf32f72a69905f881b98bf7c41308a6b16bf8d90f88b4c5238c59df9e4287d705102";

ED25519_CHAIN_INTERMEDIATE_HEX ​

📄 x509.test.vx L20-20

vex
const ED25519_CHAIN_INTERMEDIATE_HEX: str="3082016030820112a003020102021458c1104db4a3bb9b74b3c72395822b168e3be15e300506032b657030183116301406035504030c0d5665782d546573742d526f6f74301e170d3236303832303038323030335a170d3236313031393038323030335a3020311e301c06035504030c155665782d546573742d496e7465726d656469617465302a300506032b657003210040cc7d8b1b46c61a97759eba8b3a1b35e8283fe21b3b5503026e384ae222050da366306430120603551d130101ff040830060101ff020100300e0603551d0f0101ff040403020106301d0603551d0e04160414c2bb5801ea6c32ec544dabeebafbdd1fc4f80af1301f0603551d23041830168014f16d89be0b56cd120e817ec1367aa0ea44001f85300506032b65700341007475572b8e4f4f147670121117a849bf18f3d875e61ed04385dfabbba88b4af61a998d2aacaae26dfb57d0b7b1eba05905aaea0481145a103e9e43c15de73b0b";

ED25519_CHAIN_LEAF_HEX ​

📄 x509.test.vx L21-21

vex
const ED25519_CHAIN_LEAF_HEX: str="308201af30820161a003020102021410b40c7d64b161a308f84c9cce05e1b67d3e7b7e300506032b65703020311e301c06035504030c155665782d546573742d496e7465726d656469617465301e170d3236303832303038323031335a170d3236303931393038323031335a30253123302106035504030c1a69676e6f7265642d636861696e2d6c6561662e6578616d706c65302a300506032b65700321007373835b6b0165f5315694a7be5059efb4cfebea866892f7b44bb2df283f7b96a381a73081a4300c0603551d130101ff04023000300e0603551d0f0101ff04040302078030130603551d25040c300a06082b06010505070301302f0603551d11042830268211636861696e2e6578616d706c652e636f6d82112a2e7376632e6578616d706c652e636f6d301d0603551d0e04160414cc74fd43dfed83d981b0146ce2cd31bf719232cc301f0603551d23041830168014c2bb5801ea6c32ec544dabeebafbdd1fc4f80af1300506032b65700341008c46adb17d9dc1e9e1427cac424e5f12dc825eecd49a31e95d95c054dc58eb079a7b8b048ee868641f8c0225ce69d2a691dc575c4c2463512f9ee326667ad906";

ED25519_CERTIFICATE_VERIFY_HEX ​

📄 x509.test.vx L22-22

vex
const ED25519_CERTIFICATE_VERIFY_HEX: str="0f0000440807004003e209867d6e99e2c07676c00c0dc4c919b2662af2fc4036f98301dae25516a349d0c9c376d32bcd3e66f35a1aee56148e09454d5475d3708a7ae40b1949ef0e";

CERTIFICATE_CLIENT_HELLO ​

📄 x509.test.vx L23-23

vex
const CERTIFICATE_CLIENT_HELLO: [u8; 5]=[1u8, 0, 0, 1, 0];

ED25519_CHAIN_LEAF_PRIVATE ​

📄 x509.test.vx L24-29

vex
const ED25519_CHAIN_LEAF_PRIVATE: [u8; 32]=[
    0xe5u8, 0xda, 0xf1, 0x8a, 0x4c, 0xc2, 0xb4, 0xd7,
    0x6f, 0xf5, 0xe3, 0xcd, 0x79, 0x3b, 0x58, 0xcd,
    0xea, 0xab, 0x5a, 0x15, 0x40, 0x66, 0x19, 0x76,
    0x06, 0x9b, 0xde, 0x25, 0xc8, 0x43, 0x8e, 0x9f,
];

ED25519_CERT ​

📄 x509.test.vx L31-67

vex
const ED25519_CERT: [u8; 416]=[
  0x30u8, 0x82, 0x01, 0x9c, 0x30, 0x82, 0x01, 0x4e, 0xa0, 0x03, 0x02, 0x01,
  0x02, 0x02, 0x14, 0x04, 0x11, 0xc4, 0xd2, 0xce, 0xa0, 0x98, 0xd7, 0x77,
  0xc7, 0xec, 0xb8, 0xc7, 0x45, 0x1c, 0xb8, 0xe2, 0xb8, 0xf9, 0xfd, 0x30,
  0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x30, 0x23, 0x31, 0x21, 0x30, 0x1f,
  0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x18, 0x6d, 0x75, 0x73, 0x74, 0x2d,
  0x6e, 0x6f, 0x74, 0x2d, 0x62, 0x65, 0x2d, 0x75, 0x73, 0x65, 0x64, 0x2e,
  0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x30, 0x1e, 0x17, 0x0d, 0x32,
  0x36, 0x30, 0x38, 0x32, 0x30, 0x30, 0x37, 0x34, 0x36, 0x30, 0x35, 0x5a,
  0x17, 0x0d, 0x32, 0x36, 0x30, 0x39, 0x31, 0x39, 0x30, 0x37, 0x34, 0x36,
  0x30, 0x35, 0x5a, 0x30, 0x23, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55,
  0x04, 0x03, 0x0c, 0x18, 0x6d, 0x75, 0x73, 0x74, 0x2d, 0x6e, 0x6f, 0x74,
  0x2d, 0x62, 0x65, 0x2d, 0x75, 0x73, 0x65, 0x64, 0x2e, 0x65, 0x78, 0x61,
  0x6d, 0x70, 0x6c, 0x65, 0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65,
  0x70, 0x03, 0x21, 0x00, 0xa0, 0x69, 0xcc, 0x1d, 0xf3, 0x98, 0x0d, 0xae,
  0x8b, 0x37, 0xb7, 0x0e, 0x8d, 0x45, 0x8a, 0x64, 0x79, 0xf0, 0x43, 0x8c,
  0x79, 0x2a, 0xe5, 0x67, 0xcc, 0x1d, 0x4f, 0x44, 0xe7, 0x86, 0xc3, 0xff,
  0xa3, 0x81, 0x93, 0x30, 0x81, 0x90, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d,
  0x0e, 0x04, 0x16, 0x04, 0x14, 0xac, 0x8d, 0x62, 0x9f, 0x5d, 0x97, 0x9f,
  0x12, 0x17, 0xe9, 0xce, 0xcf, 0x4c, 0x4e, 0x38, 0x55, 0x43, 0x08, 0xcd,
  0xdb, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16,
  0x80, 0x14, 0xac, 0x8d, 0x62, 0x9f, 0x5d, 0x97, 0x9f, 0x12, 0x17, 0xe9,
  0xce, 0xcf, 0x4c, 0x4e, 0x38, 0x55, 0x43, 0x08, 0xcd, 0xdb, 0x30, 0x2d,
  0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x26, 0x30, 0x24, 0x82, 0x0f, 0x61,
  0x70, 0x69, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63,
  0x6f, 0x6d, 0x82, 0x11, 0x2a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
  0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x30, 0x0f, 0x06,
  0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01,
  0x01, 0xff, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff,
  0x04, 0x04, 0x03, 0x02, 0x02, 0x84, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65,
  0x70, 0x03, 0x41, 0x00, 0x95, 0x3f, 0x99, 0xa3, 0xa5, 0x48, 0x76, 0xa8,
  0x8b, 0xd7, 0xca, 0x02, 0xeb, 0x9c, 0x91, 0x36, 0x61, 0xdf, 0x54, 0xb5,
  0x01, 0x1b, 0x95, 0x16, 0xb9, 0x33, 0x0e, 0xc1, 0x0e, 0x00, 0x89, 0x1f,
  0xc1, 0x26, 0x30, 0x80, 0xec, 0x69, 0xb8, 0x6b, 0xa8, 0x8d, 0x98, 0x4b,
  0x82, 0x2d, 0x8c, 0x5c, 0x98, 0xb4, 0x4d, 0x82, 0x59, 0x75, 0x15, 0xf4,
  0x94, 0xf5, 0x17, 0xcc, 0xe4, 0xb4, 0x17, 0x09,
];

Structs ​

TlsAlert 🔓 export ​

📄 alert.vx L42-46

vex
export struct TlsAlert

Implements: Copy

Fields:

NameTypeAccess
levelTlsAlertLevel🔓 public
descriptionTlsAlertDescription🔓 public

Methods:

MethodSignatureDescription
TlsAlert.closeNotify↗export fn TlsAlert.closeNotify(): TlsAlert
TlsAlert.userCanceled↗export fn TlsAlert.userCanceled(): TlsAlert
TlsAlert.fatal↗export fn TlsAlert.fatal(description: TlsAlertDescription): Result<TlsAlert, TlsAlertError>
isCloseNotify↗export fn (self: &TlsAlert) isCloseNotify(): bool
isUserCanceled↗export fn (self: &TlsAlert) isUserCanceled(): bool
isFatal↗export fn (self: &TlsAlert) isFatal(): boolEffective TLS 1.3 severity. A peer that incorrectly labels an error alert

TlsHandshakeFeedResult 🔓 export ​

📄 assembler.vx L39-46

vex
export struct TlsHandshakeFeedResult

Implements: Copy

Fields:

NameTypeAccess
kindTlsHandshakeFeedKind🔓 public
consumedusize🔓 public
messageTypeu8🔓 public
bodyLenusize🔓 public
encodedLenusize🔓 public

Methods:

MethodSignatureDescription
isComplete↗export fn (self: &TlsHandshakeFeedResult) isComplete(): bool
isDirect↗export fn (self: &TlsHandshakeFeedResult) isDirect(): bool

TlsHandshakeAssembler 🔓 export ​

📄 assembler.vx L117-127

vex
export struct TlsHandshakeAssembler

Allocation-free, one-message-at-a-time TLS Handshake assembler.

The common aligned path is zero-copy. A fragmented message is written into a caller-owned span whose address must remain stable until completion. This makes lifetime, allocation policy, and maximum certificate size explicit at the connection layer instead of hiding them in TLS.

Fields:

NameTypeAccess
maxBodyLenusize🔒 private
headerBytes[u8; 4]🔒 private
headerLenusize🔒 private
messageTypeu8🔒 private
bodyLenusize🔒 private
encodedLenusize🔒 private
writtenusize🔒 private
outputAddressusize🔒 private
outputBoundbool🔒 private

Methods:

MethodSignatureDescription
TlsHandshakeAssembler.new↗export fn TlsHandshakeAssembler.new(maxBodyLen: usize): Result<TlsHandshakeAssembler, TlsHandshakeAssemblerError>
TlsHandshakeAssembler.withProtocolLimit↗export fn TlsHandshakeAssembler.withProtocolLimit(): TlsHandshakeAssembler
isIdle↗export fn (self: &TlsHandshakeAssembler) isIdle(): bool
maxMessageBodyLen↗export fn (self: &TlsHandshakeAssembler) maxMessageBodyLen(): usize
pendingLen↗export fn (self: &TlsHandshakeAssembler) pendingLen(): usizeReturns bytes already retained for the fragmented message. A partial
clearPending↗fn (self: &TlsHandshakeAssembler!) clearPending()
abort↗export fn (self: &TlsHandshakeAssembler!) abort()Explicitly abandons a partial message after the connection has entered a
requireNonHandshakeBoundary↗export fn (self: &TlsHandshakeAssembler) requireNonHandshakeBoundary(): Result<bool, TlsHandshakeAssemblerError>RFC 8446 forbids interleaving another record content type through a
requireKeyChangeBoundary↗export fn (self: &TlsHandshakeAssembler) requireKeyChangeBoundary(): Result<bool, TlsHandshakeAssemblerError>Handshake messages may not cross a record-protection key change.
validateHeader↗fn (self: &TlsHandshakeAssembler) validateHeader(header: TlsHandshakeHeader): Result<usize, TlsHandshakeAssemblerError>
feed↗export fn (self: &TlsHandshakeAssembler!) feed(fragment: Span<u8>, output: &Span<u8>!): Result<TlsHandshakeFeedResult, TlsHandshakeAssemblerError>Consumes at most one complete Handshake message from fragment.

TlsCertificateEntryView 🔓 export ​

📄 certificate.vx L86-91

vex
export struct TlsCertificateEntryView

Implements: Copy

Fields:

NameTypeAccess
certificateTlsWireSlice🔓 public
extensionsTlsWireSlice🔓 public
extensionCountusize🔓 public

TlsCertificateMessageView 🔓 export ​

📄 certificate.vx L93-97

vex
export struct TlsCertificateMessageView

Implements: Copy

Fields:

NameTypeAccess
certificateListTlsWireSlice🔓 public
certificateCountusize🔓 public

Methods:

MethodSignatureDescription
entryAt↗export fn (self: &TlsCertificateMessageView) entryAt(encoded: Span<u8>, index: usize): Result<TlsCertificateEntryView, TlsCertificateError>

TlsCertificateVerifyView 🔓 export ​

📄 certificate.vx L221-225

vex
export struct TlsCertificateVerifyView

Implements: Copy

Fields:

NameTypeAccess
algorithmu16🔓 public
signatureTlsWireSlice🔓 public

TlsTrafficKeyLengths 🔓 export ​

📄 handshake.vx L56-60

vex
export struct TlsTrafficKeyLengths

Implements: Copy

Fields:

NameTypeAccess
keyusize🔓 public
ivusize🔓 public

TlsWireSlice 🔓 export ​

📄 hello.vx L63-68

vex
export struct TlsWireSlice

Offset/length pair into the complete encoded Handshake message. No pointer

escapes the input lifetime; callers resolve the view against the same encoded span when needed.

Implements: Copy

Fields:

NameTypeAccess
presentbool🔓 public
offsetusize🔓 public
lengthusize🔓 public

Methods:

MethodSignatureDescription
resolve↗export fn (self: &TlsWireSlice) resolve(encoded: Span<u8>): Result<Span<u8>, TlsHelloError>

TlsHelloExtensions 🔓 export ​

📄 hello.vx L90-103

vex
export struct TlsHelloExtensions

Implements: Copy

Fields:

NameTypeAccess
countusize🔓 public
encodedBlockTlsWireSlice🔓 public
supportedVersionsTlsWireSlice🔓 public
supportedGroupsTlsWireSlice🔓 public
signatureAlgorithmsTlsWireSlice🔓 public
keyShareTlsWireSlice🔓 public
serverNameTlsWireSlice🔓 public
alpnTlsWireSlice🔓 public
preSharedKeyTlsWireSlice🔓 public
pskKeyExchangeModesTlsWireSlice🔓 public
cookieTlsWireSlice🔓 public

Methods:

MethodSignatureDescription
entryAt↗export fn (self: &TlsHelloExtensions) entryAt(encoded: Span<u8>, index: usize): Result<TlsExtensionEntry, TlsHelloError>Resolves an extension by stable wire order. Unknown extension identities
find↗export fn (self: &TlsHelloExtensions) find(encoded: Span<u8>, extensionType: u16): Result<Option<TlsWireSlice>, TlsHelloError>

TlsExtensionEntry 🔓 export ​

📄 hello.vx L121-125

vex
export struct TlsExtensionEntry

Implements: Copy

Fields:

NameTypeAccess
extensionTypeu16🔓 public
dataTlsWireSlice🔓 public

TlsKeyShareEntry 🔓 export ​

📄 hello.vx L127-131

vex
export struct TlsKeyShareEntry

Implements: Copy

Fields:

NameTypeAccess
groupu16🔓 public
keyExchangeTlsWireSlice🔓 public

TlsClientHelloView 🔓 export ​

📄 hello.vx L193-201

vex
export struct TlsClientHelloView

Implements: Copy

Fields:

NameTypeAccess
encodedLenusize🔓 public
random[u8; 32]🔓 public
sessionIdTlsWireSlice🔓 public
cipherSuitesTlsWireSlice🔓 public
cipherSuiteCountusize🔓 public
extensionsTlsHelloExtensions🔓 public

Methods:

MethodSignatureDescription
cipherSuiteAt↗export fn (self: &TlsClientHelloView) cipherSuiteAt(encoded: Span<u8>, index: usize): Result<u16, TlsHelloError>
signatureSchemeCount↗export fn (self: &TlsClientHelloView) signatureSchemeCount(): usizeReturns the number of structurally validated signature schemes advertised
signatureSchemeAt↗export fn (self: &TlsClientHelloView) signatureSchemeAt(encoded: Span<u8>, index: usize): Result<u16, TlsHelloError>Resolves one advertised signature scheme by wire order. Bounds and backing
supportsGroup↗export fn (self: &TlsClientHelloView) supportsGroup(encoded: Span<u8>, group: u16): Result<bool, TlsHelloError>Reports whether the structurally validated supported_groups vector
keyShareAt↗export fn (self: &TlsClientHelloView) keyShareAt(encoded: Span<u8>, index: usize): Result<TlsKeyShareEntry, TlsHelloError>Resolves one validated ClientHello KeyShareEntry by wire order.
findKeyShare↗export fn (self: &TlsClientHelloView) findKeyShare(encoded: Span<u8>, group: u16): Result<Option<TlsWireSlice>, TlsHelloError>

TlsServerHelloView 🔓 export ​

📄 hello.vx L339-347

vex
export struct TlsServerHelloView

Implements: Copy

Fields:

NameTypeAccess
encodedLenusize🔓 public
random[u8; 32]🔓 public
sessionIdTlsWireSlice🔓 public
cipherSuiteu16🔓 public
helloRetryRequestbool🔓 public
extensionsTlsHelloExtensions🔓 public

Methods:

MethodSignatureDescription
selectedKeyShare↗export fn (self: &TlsServerHelloView) selectedKeyShare(encoded: Span<u8>): Result<TlsKeyShareEntry, TlsHelloError>Resolves the sole normal ServerHello KeyShareEntry. HelloRetryRequest has

TlsDnsIdentityError 🔓 export ​

📄 hostname.vx L10-14

vex
export struct TlsDnsIdentityError

Implements: Copy

Fields:

NameTypeAccess
kindTlsDnsIdentityErrorKind🔓 public
offsetusize🔓 public

Methods:

MethodSignatureDescription
isKind↗export fn (self: &TlsDnsIdentityError) isKind(kind: TlsDnsIdentityErrorKind): bool

TlsDnsIdentity 🔓 export ​

📄 hostname.vx L25-25

vex
export struct TlsDnsIdentity

Strict service-identity matcher. This API compares a DNS reference name

only with an X.509 subjectAltName dNSName. It deliberately has no common name fallback and does not reinterpret IP literals as DNS names.

Methods:

MethodSignatureDescription
TlsDnsIdentity.matches↗export fn TlsDnsIdentity.matches(reference: str, presentedDnsId: Span<u8>): Result<bool, TlsDnsIdentityError>Matches a caller reference hostname against the raw bytes of one dNSName

TlsSecretSchedule 🔓 export ​

📄 key_schedule.vx L131-135

vex
export struct TlsSecretSchedule

Move-only owner of the current raw secret on the left side of RFC 8446's

key-schedule diagram. Only ordered Early -> Handshake -> Master transitions are exposed. Working secrets are erased on every transition and on Drop.

Implements: Drop

Fields:

NameTypeAccess
hashTlsHashAlgorithm🔒 private
stageTlsSecretStage🔒 private
secret[u8; 48]🔒 private

Methods:

MethodSignatureDescription
TlsSecretSchedule.new↗export fn TlsSecretSchedule.new(hash: TlsHashAlgorithm, psk: Span<u8>): Result<TlsSecretSchedule, TlsKeyScheduleError>Starts the schedule at Early Secret. An empty PSK means the RFC 8446
stage↗export fn (self: &TlsSecretSchedule) stage(): TlsSecretStage
hashAlgorithm↗export fn (self: &TlsSecretSchedule) hashAlgorithm(): TlsHashAlgorithm
drop↗export fn (self: &TlsSecretSchedule!) drop()
retire↗export fn (self: &TlsSecretSchedule!) retire()Irreversibly erases a candidate schedule that negotiation did not select.
deriveHandshakeTraffic↗export fn (self: &TlsSecretSchedule!) deriveHandshakeTraffic(sharedSecret: Span<u8>, transcript: &TlsTranscript, clientOut: &Span<u8>!, serverOut: &Span<u8>!): Result<usize, TlsKeyScheduleError>Commits Early -> Handshake and writes client/server handshake traffic
deriveApplicationTraffic↗export fn (self: &TlsSecretSchedule!) deriveApplicationTraffic(transcript: &TlsTranscript, clientOut: &Span<u8>!, serverOut: &Span<u8>!): Result<usize, TlsKeyScheduleError>Commits Handshake -> Master and writes generation-0 application traffic

TlsX25519Negotiation 🔓 export ​

📄 negotiation.vx L157-194

vex
export struct TlsX25519Negotiation

Move-only owner for the authenticated no-PSK TLS 1.3 client handshake.

Hello negotiation is also usable in server role, while the monotonic server authentication flight is client-only. Transcript, key schedule, offered capabilities and Finished traffic secrets have one lifetime and one state authority; borrowed wire views never escape a call.

Implements: Drop

Fields:

NameTypeAccess
roleValueTlsHandshakeRole🔒 private
stageValueTlsX25519NegotiationStage🔒 private
transcriptValueTlsTranscript🔒 private
schedule256TlsSecretSchedule🔒 private
schedule384TlsSecretSchedule🔒 private
localPrivate[u8; 32]🔒 private
localPublic[u8; 32]🔒 private
peerPublic[u8; 32]🔒 private
peerReadybool🔒 private
sessionId[u8; 32]🔒 private
sessionLenusize🔒 private
offeredAes128bool🔒 private
offeredAes256bool🔒 private
offeredChaChabool🔒 private
offeredEd25519bool🔒 private
offeredExtensions[u16; 64]🔒 private
offeredExtensionCountusize🔒 private
offeredAlpnVec<u8>🔒 private
selectedAlpnVec<u8>🔒 private
clientHandshakeTraffic[u8; 48]🔒 private
serverHandshakeTraffic[u8; 48]🔒 private
handshakeTrafficReadybool🔒 private
serverCertificatePublicKey[u8; 32]🔒 private
serverCertificateKeyReadybool🔒 private
selectedCipherValueu16🔒 private
selectedHashValueTlsHashAlgorithm🔒 private
selectedbool🔒 private
clientHelloInvariant[u8; 32]🔒 private
clientHelloInvariantReadybool🔒 private
initialKeyShareOfferedbool🔒 private
initialKeyShareLenusize🔒 private
initialKeyShareDigest[u8; 32]🔒 private
retryKeyShareRequestedbool🔒 private
retryCookiePresentbool🔒 private
retryCookieLenusize🔒 private
retryCookieDigest[u8; 32]🔒 private

Methods:

MethodSignatureDescription
TlsX25519Negotiation.new↗export fn TlsX25519Negotiation.new(role: TlsHandshakeRole, privateKey: Span<u8>, transcriptLimit: usize): Result<TlsX25519Negotiation, TlsX25519NegotiationError>Creates a role-bound no-PSK negotiation owner, copies the exact 32-byte
TlsX25519Negotiation.withDefaultLimit↗export fn TlsX25519Negotiation.withDefaultLimit(role: TlsHandshakeRole, privateKey: Span<u8>): Result<TlsX25519Negotiation, TlsX25519NegotiationError>Creates a negotiation owner with TLS_DEFAULT_TRANSCRIPT_LIMIT.
role↗export fn (self: &TlsX25519Negotiation) role(): TlsHandshakeRoleReturns the immutable endpoint role.
stage↗export fn (self: &TlsX25519Negotiation) stage(): TlsX25519NegotiationStageReturns the monotonic negotiation stage.
transcript↗export fn (self: &TlsX25519Negotiation) transcript(): &TlsTranscriptBorrows the transcript for read-only accounting or digest snapshots.
selectedCipher↗export fn (self: &TlsX25519Negotiation) selectedCipher(): Option<u16>Returns the selected suite after successful normal ServerHello processing.
selectedHash↗export fn (self: &TlsX25519Negotiation) selectedHash(): Option<TlsHashAlgorithm>Returns the suite-authoritative hash after successful negotiation.
publicKeyTo↗export fn (self: &TlsX25519Negotiation) publicKeyTo(output: &Span<u8>!): Result<usize, TlsX25519NegotiationError>Copies the non-secret local public key into an exact 32-byte destination.
commitClientHello↗export fn (self: &TlsX25519Negotiation!) commitClientHello(encoded: Span<u8>): Result<usize, TlsX25519NegotiationError>Validates and commits the exact ClientHello that entered the transcript.
commitRetryClientHello↗export fn (self: &TlsX25519Negotiation!) commitRetryClientHello(encoded: Span<u8>, retryPrivateKey: Span<u8>): Result<usize, TlsX25519NegotiationError>Validates and commits ClientHello2 after one authenticated
cipherWasOffered↗fn (self: &TlsX25519Negotiation) cipherWasOffered(cipherSuite: u16): bool
acceptServerHello↗export fn (self: &TlsX25519Negotiation!) acceptServerHello(encoded: Span<u8>, clientTrafficOut: &Span<u8>!, serverTrafficOut: &Span<u8>!): Result<usize, TlsX25519NegotiationError>Validates normal ServerHello, computes the contributory X25519 secret, and
extensionWasOffered↗fn (self: &TlsX25519Negotiation) extensionWasOffered(identity: u16): bool
alpnWasOffered↗fn (self: &TlsX25519Negotiation) alpnWasOffered(selected: Span<u8>): bool
validateEncryptedExtensions↗fn (self: &TlsX25519Negotiation) validateEncryptedExtensions(encoded: Span<u8>): Result<TlsEncryptedExtensionsCandidate, TlsX25519NegotiationError>
acceptEncryptedExtensions↗export fn (self: &TlsX25519Negotiation!) acceptEncryptedExtensions(encoded: Span<u8>): Result<usize, TlsX25519NegotiationError>Validates and commits the server EncryptedExtensions flight. The current
selectedAlpnLen↗export fn (self: &TlsX25519Negotiation) selectedAlpnLen(): usizeReturns the authenticated server ALPN selection length after server
selectedAlpnTo↗export fn (self: &TlsX25519Negotiation) selectedAlpnTo(output: &Span<u8>!): Result<usize, TlsX25519NegotiationError>Copies the authenticated ALPN selection to caller storage.
acceptServerCertificate↗export fn (self: &TlsX25519Negotiation!) acceptServerCertificate(encoded: Span<u8>, trustAnchor: Span<u8>, referenceDnsName: str, unixSeconds: i64): Result<usize, TlsX25519NegotiationError>Validates the server Certificate list against an explicit trust anchor,
acceptServerCertificateVerify↗export fn (self: &TlsX25519Negotiation!) acceptServerCertificateVerify(encoded: Span<u8>): Result<usize, TlsX25519NegotiationError>Verifies and commits server CertificateVerify only when Ed25519 was offered
failAuthenticatedFlight↗fn (self: &TlsX25519Negotiation!) failAuthenticatedFlight()
acceptServerFinished↗export fn (self: &TlsX25519Negotiation!) acceptServerFinished(encoded: Span<u8>, clientApplicationOut: &Span<u8>!, serverApplicationOut: &Span<u8>!): Result<usize, TlsX25519NegotiationError>Constant-time verifies and commits the peer Finished, then derives
writeClientFinished↗export fn (self: &TlsX25519Negotiation!) writeClientFinished(output: &Span<u8>!): Result<usize, TlsX25519NegotiationError>Emits and commits the client's Finished message. Application traffic was
drop↗export fn (self: &TlsX25519Negotiation!) drop()

TlsEncryptedExtensionsCandidate ​

📄 negotiation.vx L1145-1148

vex
struct TlsEncryptedExtensionsCandidate

Fields:

NameTypeAccess
selectedAlpnOffsetusize🔒 private
selectedAlpnLenusize🔒 private

TlsRecordHeader 🔓 export ​

📄 record.vx L28-33

vex
export struct TlsRecordHeader

Fields:

NameTypeAccess
contentTypeu8🔓 public
versionu16🔓 public
lengthu16🔓 public

TlsPlaintext 🔓 export ​

📄 record.vx L54-58

vex
export struct TlsPlaintext

Metadata recovered from an authenticated TLSInnerPlaintext.

Implements: Copy

Fields:

NameTypeAccess
lengthu64🔓 public
contentTypeu8🔓 public

TlsCipherState 🔓 export ​

📄 record.vx L86-92

vex
export struct TlsCipherState

Owning, move-only per-direction TLS 1.3 record state.

Key material and the sequence number are deliberately private. Exposing a writable sequence would let application code reuse a nonce with the same traffic key, which is catastrophic for every supported AEAD.

Implements: Drop

Fields:

NameTypeAccess
cipherIdu16🔒 private
key[u8; 32]🔒 private
keyLenusize🔒 private
iv[u8; 12]🔒 private
sequ64🔒 private

Methods:

MethodSignatureDescription
TlsCipherState.new↗export fn TlsCipherState.new(cipherId: u16, key: Span<u8>, iv: Span<u8>): Result<TlsCipherState, TlsRecordError>
sequence↗export fn (self: &TlsCipherState) sequence(): u64
validateRekeyMaterial↗fn (self: &TlsCipherState) validateRekeyMaterial(key: Span<u8>, iv: Span<u8>): Result<bool, TlsRecordError>Atomically installs the next key generation for this direction.
commitRekey↗fn (self: &TlsCipherState!) commitRekey(key: Span<u8>, iv: Span<u8>)
rekey↗export fn (self: &TlsCipherState!) rekey(key: Span<u8>, iv: Span<u8>): Result<bool, TlsRecordError>
retire↗export fn (self: &TlsCipherState!) retire()Irreversibly erases this direction's traffic key and IV. Transport owners
drop↗export fn (self: &TlsCipherState!) drop()
keyBuf↗fn (self: &TlsCipherState) keyBuf(): RawBuf
ivBuf↗fn (self: &TlsCipherState) ivBuf(): RawBuf
encryptRecord↗export fn (self: &TlsCipherState!) encryptRecord(contentType: u8, plaintext: Span<u8>, outRecord: &Span<u8>!): Result<usize, TlsRecordError>
encryptRecordThenRekey↗export fn (self: &TlsCipherState!) encryptRecordThenRekey(contentType: u8, plaintext: Span<u8>, outRecord: &Span<u8>!, nextKey: Span<u8>, nextIv: Span<u8>): Result<usize, TlsRecordError>Encrypts one record under the current generation and atomically installs
decryptRecord↗export fn (self: &TlsCipherState!) decryptRecord(record: Span<u8>, outPlain: &Span<u8>!): Result<TlsPlaintext, TlsRecordError>

TlsHandshakeHeader 🔓 export ​

📄 transcript.vx L38-42

vex
export struct TlsHandshakeHeader

The exact four-byte TLS Handshake header: one-byte type and uint24 body

length. Record-layer headers are intentionally outside this type.

Implements: Copy

Fields:

NameTypeAccess
messageTypeu8🔓 public
bodyLenusize🔓 public

TlsTranscript 🔓 export ​

📄 transcript.vx L90-104

vex
export struct TlsTranscript

Streaming, allocation-free TLS 1.3 transcript state.

acceptedBytes is a monotonic resource-accounting counter and is never reduced by HelloRetryRequest rewriting. hashedBytes reports the effective transcript size after the RFC 8446 synthetic message_hash replacement.

Implements: Drop

Fields:

NameTypeAccess
hashTlsHashAlgorithm🔒 private
hashSelectedbool🔒 private
sha256Availablebool🔒 private
sha384Availablebool🔒 private
sha256Sha256🔒 private
sha384Sha384🔒 private
byteLimitusize🔒 private
acceptedBytesusize🔒 private
hashedBytesusize🔒 private
messageCountusize🔒 private
firstMessageTypeu8🔒 private
lastMessageTypeu8🔒 private
retryRewrittenbool🔒 private

Methods:

MethodSignatureDescription
TlsTranscript.new↗export fn TlsTranscript.new(byteLimit: usize): Result<TlsTranscript, TlsTranscriptError>Constructs a dual SHA-256/SHA-384 transcript with an explicit resource
TlsTranscript.newForHash↗export fn TlsTranscript.newForHash(hash: TlsHashAlgorithm, byteLimit: usize): Result<TlsTranscript, TlsTranscriptError>Constructs a transcript whose cipher-suite hash is already known.
TlsTranscript.withDefaultLimit↗export fn TlsTranscript.withDefaultLimit(): TlsTranscriptConstructs a dual transcript with the 16 MiB default input budget.
TlsTranscript.withDefaultHash↗export fn TlsTranscript.withDefaultHash(hash: TlsHashAlgorithm): TlsTranscriptConstructs a selected-hash transcript with the 16 MiB default budget.
selectedHash↗export fn (self: &TlsTranscript) selectedHash(): Option<TlsHashAlgorithm>Returns the committed suite hash, or None while both candidates are live.
limit↗export fn (self: &TlsTranscript) limit(): usizeReturns the immutable accepted-input byte budget.
acceptedLen↗export fn (self: &TlsTranscript) acceptedLen(): usizeReturns bytes accepted from complete peer/local Handshake messages.
hashedLen↗export fn (self: &TlsTranscript) hashedLen(): usizeReturns the effective bytes represented by the running hash state.
messages↗export fn (self: &TlsTranscript) messages(): usizeReturns the number of effective messages in the running transcript.
lastMessage↗export fn (self: &TlsTranscript) lastMessage(): Option<u8>Returns the most recently committed Handshake type. An empty transcript
didRewriteHelloRetry↗export fn (self: &TlsTranscript) didRewriteHelloRetry(): boolReports whether the ClientHello1 synthetic-hash rewrite was committed.
drop↗export fn (self: &TlsTranscript!) drop()
absorbRaw↗fn (self: &TlsTranscript!) absorbRaw(input: RawBuf, length: usize)
selectHash↗export fn (self: &TlsTranscript!) selectHash(hash: TlsHashAlgorithm): Result<bool, TlsTranscriptError>Commits the cipher-suite hash. Re-selecting the same hash is idempotent;
validateAppend↗fn (self: &TlsTranscript) validateAppend(messageType: u8, encodedLen: usize): Result<bool, TlsTranscriptError>
commitMessage↗fn (self: &TlsTranscript!) commitMessage(messageType: u8, encoded: RawBuf, encodedLen: usize)
appendEncoded↗export fn (self: &TlsTranscript!) appendEncoded(encoded: Span<u8>): Result<usize, TlsTranscriptError>Validates and appends one complete encoded TLS Handshake message. The
appendMessage↗export fn (self: &TlsTranscript!) appendMessage(messageType: u8, body: Span<u8>): Result<usize, TlsTranscriptError>Appends a body while generating the authenticated handshake header. This
digestTo↗export fn (self: &TlsTranscript) digestTo(output: &Span<u8>!): Result<usize, TlsTranscriptError>Writes the current transcript hash without finalizing the running state.
digestFor↗export fn (self: &TlsTranscript) digestFor(hash: TlsHashAlgorithm, output: &Span<u8>!): Result<usize, TlsTranscriptError>Snapshots either candidate hash before cipher-suite selection. After
rewriteForHelloRetryRequest↗export fn (self: &TlsTranscript!) rewriteForHelloRetryRequest(): Result<usize, TlsTranscriptError>Applies RFC 8446 section 4.4.1's HelloRetryRequest rewrite.

TlsTransportEvent 🔓 export ​

📄 transport.vx L44-50

vex
export struct TlsTransportEvent

Fields:

NameTypeAccess
kindTlsTransportEventKind🔓 public
lengthusize🔓 public
alertOption<TlsAlert>🔓 public
keyUpdateOption<TlsKeyUpdateRequest>🔓 public

TlsTransportError 🔓 export ​

📄 transport.vx L65-72

vex
export struct TlsTransportError

Typed transport failure with the exact lower-layer cause retained when one

exists. Caller-capacity/overlap mistakes remain retryable; authenticated wire failures retire both traffic directions.

Fields:

NameTypeAccess
kindTlsTransportErrorKind🔓 public
recordCauseOption<TlsRecordError>🔓 public
alertCauseOption<TlsAlertError>🔓 public
scheduleCauseOption<TlsKeyScheduleError>🔓 public
keyUpdateCauseOption<TlsKeyUpdateError>🔓 public

Methods:

MethodSignatureDescription
isKind↗export fn (self: &TlsTransportError) isKind(kind: TlsTransportErrorKind): bool

TlsApplicationTraffic 🔓 export ​

📄 transport.vx L158-176

vex
export struct TlsApplicationTraffic

Owns exactly one protected send direction and one protected receive

direction after generation-0 application traffic secrets exist. The constructor derives keys directly into bounded stack candidates, transfers them into move-only cipher states, then erases every candidate. Callers pass directional secrets explicitly: sendSecret is always local output and receiveSecret is always peer output, independent of role.

Implements: Drop

Fields:

NameTypeAccess
sendTlsCipherState🔒 private
receiveTlsCipherState🔒 private
cipherIdu16🔒 private
hashTlsHashAlgorithm🔒 private
digestLenusize🔒 private
sendSecret[u8; 48]🔒 private
receiveSecret[u8; 48]🔒 private
sendGenerationu64🔒 private
receiveGenerationu64🔒 private
keyUpdateResponsePendingbool🔒 private
postHandshake[u8; 5]🔒 private
postHandshakeLenusize🔒 private
localClosedbool🔒 private
peerClosedbool🔒 private
peerCanceledbool🔒 private
localCanceledbool🔒 private
failedbool🔒 private

Methods:

MethodSignatureDescription
TlsApplicationTraffic.new↗export fn TlsApplicationTraffic.new(cipherId: u16, sendSecret: Span<u8>, receiveSecret: Span<u8>): Result<TlsApplicationTraffic, TlsTransportError>
state↗export fn (self: &TlsApplicationTraffic) state(): TlsTransportState
sendSequence↗export fn (self: &TlsApplicationTraffic) sendSequence(): u64
receiveSequence↗export fn (self: &TlsApplicationTraffic) receiveSequence(): u64
sendGeneration↗export fn (self: &TlsApplicationTraffic) sendGeneration(): u64
receiveGeneration↗export fn (self: &TlsApplicationTraffic) receiveGeneration(): u64
keyUpdateResponseRequired↗export fn (self: &TlsApplicationTraffic) keyUpdateResponseRequired(): bool
retireSendDirection↗fn (self: &TlsApplicationTraffic!) retireSendDirection()
retireReceiveDirection↗fn (self: &TlsApplicationTraffic!) retireReceiveDirection()
retireFailed↗fn (self: &TlsApplicationTraffic!) retireFailed()
encryptApplicationData↗export fn (self: &TlsApplicationTraffic!) encryptApplicationData(plaintext: Span<u8>, output: &Span<u8>!): Result<usize, TlsTransportError>
writeKeyUpdate↗export fn (self: &TlsApplicationTraffic!) writeKeyUpdate(request: TlsKeyUpdateRequest, output: &Span<u8>!): Result<usize, TlsTransportError>Sends a complete KeyUpdate under the current send generation and commits
writeAlertPayload↗fn (self: &TlsApplicationTraffic!) writeAlertPayload(alert: TlsAlert, output: &Span<u8>!): Result<usize, TlsTransportError>
writeUserCanceled↗export fn (self: &TlsApplicationTraffic!) writeUserCanceled(output: &Span<u8>!): Result<usize, TlsTransportError>Sends the TLS 1.3 user_canceled warning once without retiring the send key.
writeCloseNotify↗export fn (self: &TlsApplicationTraffic!) writeCloseNotify(output: &Span<u8>!): Result<usize, TlsTransportError>Encrypts close_notify exactly once, then erases the send-direction key.
writeFatalAlert↗export fn (self: &TlsApplicationTraffic!) writeFatalAlert(description: TlsAlertDescription, output: &Span<u8>!): Result<usize, TlsTransportError>Emits one fatal alert and immediately retires both directions after the
readKeyUpdateFragment↗fn (self: &TlsApplicationTraffic!) readKeyUpdateFragment(fragment: Span<u8>): Result<TlsTransportEvent, TlsTransportError>
readRecord↗export fn (self: &TlsApplicationTraffic!) readRecord(record: Span<u8>, plaintext: &Span<u8>!): Result<TlsTransportEvent, TlsTransportError>Authenticates and classifies one protected application-phase record.
drop↗export fn (self: &TlsApplicationTraffic!) drop()

TlsNextTrafficGeneration ​

📄 transport.vx L313-318

vex
struct TlsNextTrafficGeneration

Implements: Drop

Fields:

NameTypeAccess
secret[u8; 48]🔒 private
key[u8; 32]🔒 private
iv[u8; 12]🔒 private
keyLenusize🔒 private

Methods:

MethodSignatureDescription
drop↗fn (self: &TlsNextTrafficGeneration!) drop()

X509Error 🔓 export ​

📄 x509.vx L46-50

vex
export struct X509Error

Implements: Copy

Fields:

NameTypeAccess
kindX509ErrorKind🔓 public
offsetusize🔓 public

Methods:

MethodSignatureDescription
isKind↗export fn (self: &X509Error) isKind(kind: X509ErrorKind): bool

X509CertificateView 🔓 export ​

📄 x509.vx L131-141

vex
export struct X509CertificateView

Allocation-free certificate view. The caller retains the DER bytes for the

complete lifetime of this value and passes the same span to every method.

Implements: Copy

Fields:

NameTypeAccess
certificateDerSlice🔒 private
tbsCertificateDerSlice🔒 private
signatureDerSlice🔒 private
publicKeyDerSlice🔒 private
issuerDerSlice🔒 private
validityDerSlice🔒 private
subjectDerSlice🔒 private
extensionsDerSlice🔒 private
hasExtensionsbool🔒 private

Methods:

MethodSignatureDescription
X509CertificateView.parse↗export fn X509CertificateView.parse(input: Span<u8>): Result<X509CertificateView, X509Error>Parses the structural certificate envelope and admits only RFC 8410
publicKeyBytes↗export fn (self: &X509CertificateView) publicKeyBytes(input: Span<u8>): Result<Span<u8>, X509Error>
verifySignatureWith↗export fn (self: &X509CertificateView) verifySignatureWith(input: Span<u8>, issuerInput: Span<u8>, issuer: &X509CertificateView): Result<bool, X509Error>Verifies this certificate signature with the issuer's Ed25519 SPKI. Chain
validityRange↗export fn (self: &X509CertificateView) validityRange(input: Span<u8>): Result<(i64, i64), X509Error>
validateAt↗export fn (self: &X509CertificateView) validateAt(input: Span<u8>, unixSeconds: i64): Result<bool, X509Error>
dnsNameCount↗export fn (self: &X509CertificateView) dnsNameCount(input: Span<u8>): Result<usize, X509Error>
dnsNameAt↗export fn (self: &X509CertificateView) dnsNameAt(input: Span<u8>, wanted: usize): Result<Span<u8>, X509Error>
matchesDnsName↗export fn (self: &X509CertificateView) matchesDnsName(input: Span<u8>, reference: str): Result<bool, X509Error>Checks every SAN dNSName. Invalid presented identities fail closed instead

X509ExtensionView ​

📄 x509.vx L528-532

vex
struct X509ExtensionView

Implements: Copy

Fields:

NameTypeAccess
oidDerElement🔒 private
valueDerElement🔒 private
criticalbool🔒 private

X509ExtensionPolicy ​

📄 x509.vx L600-613

vex
struct X509ExtensionPolicy

Implements: Copy

Fields:

NameTypeAccess
hasBasicConstraintsbool🔒 private
basicConstraintsCriticalbool🔒 private
certificateAuthoritybool🔒 private
hasPathLengthbool🔒 private
pathLengthusize🔒 private
hasKeyUsagebool🔒 private
digitalSignaturebool🔒 private
certificateSignbool🔒 private
hasExtendedKeyUsagebool🔒 private
serverAuthbool🔒 private
hasSubjectAltNamebool🔒 private
subjectAltNameCriticalbool🔒 private

X509TlsServerVerifier 🔓 export ​

📄 x509.vx L1000-1000

vex
export struct X509TlsServerVerifier

Bounded TLS server-certificate verifier for the currently supported

Ed25519 profile. Intermediates are presented in leaf-to-anchor order and the explicit trust anchor is not included in intermediateInputs. Validation is allocation-free and never consults an OS/libc root store.

Methods:

MethodSignatureDescription
X509TlsServerVerifier.verifyChain↗export fn X509TlsServerVerifier.verifyChain(leafInput: Span<u8>, intermediateInputs: Span<Span<u8>>, trustAnchorInput: Span<u8>, referenceDnsName: str, unixSeconds: i64): Result<bool, X509Error>
X509TlsServerVerifier.verifyDirect↗export fn X509TlsServerVerifier.verifyDirect(leafInput: Span<u8>, trustAnchorInput: Span<u8>, referenceDnsName: str, unixSeconds: i64): Result<bool, X509Error>Convenience path for a leaf signed directly by the explicit trust anchor.

Enums ​

TlsAlertLevel 🔓 export ​

📄 alert.vx L7-10

vex
export enum TlsAlertLevel

Variants:

  • Warning
  • Fatal

TlsAlertDescription 🔓 export ​

📄 alert.vx L12-40

vex
export enum TlsAlertDescription

Variants:

  • CloseNotify
  • UnexpectedMessage
  • BadRecordMac
  • RecordOverflow
  • HandshakeFailure
  • BadCertificate
  • UnsupportedCertificate
  • CertificateRevoked
  • CertificateExpired
  • CertificateUnknown
  • IllegalParameter
  • UnknownCa
  • AccessDenied
  • DecodeError
  • DecryptError
  • ProtocolVersion
  • InsufficientSecurity
  • InternalError
  • InappropriateFallback
  • UserCanceled
  • MissingExtension
  • UnsupportedExtension
  • UnrecognizedName
  • BadCertificateStatusResponse
  • UnknownPskIdentity
  • CertificateRequired
  • NoApplicationProtocol

TlsAlertError 🔓 export ​

📄 alert.vx L48-54

vex
export enum TlsAlertError

Variants:

  • InvalidBuffer
  • InvalidLength
  • InvalidLevel
  • UnknownDescription
  • NonCanonicalLevel

Methods:

MethodSignatureDescription
isKind↗export fn (self: &TlsAlertError) isKind(kind: TlsAlertError): bool

TlsHandshakeAssemblerError 🔓 export ​

📄 assembler.vx L13-21

vex
export enum TlsHandshakeAssemblerError

Failures produced while turning arbitrarily fragmented record payloads

back into complete TLS Handshake messages. Rejected input never partially advances the assembler.

Variants:

  • InvalidLimit
  • InvalidInput
  • InvalidOutput
  • MessageTooLarge
  • OutputChanged
  • InterleavedRecord
  • KeyChangeWhileFragmented

Methods:

MethodSignatureDescription
isKind↗export fn (self: &TlsHandshakeAssemblerError) isKind(kind: TlsHandshakeAssemblerError): bool

TlsHandshakeFeedKind 🔓 export ​

📄 assembler.vx L33-37

vex
export enum TlsHandshakeFeedKind

CompleteDirect means the complete message is the first encodedLen

bytes of the supplied fragment. CompleteBuffered means it is in the caller-owned output span. NeedMore consumes the reported prefix and keeps bounded state for the next record.

Variants:

  • NeedMore
  • CompleteDirect
  • CompleteBuffered

TlsCertificateError 🔓 export ​

📄 certificate.vx L17-30

vex
export enum TlsCertificateError

Variants:

  • InvalidInput
  • InvalidMessageType
  • InvalidMessageLength
  • NonEmptyServerContext
  • EmptyCertificateList
  • EmptyCertificate
  • ResourceLimit
  • DuplicateExtension
  • InvalidState
  • UnsupportedSignatureAlgorithm
  • InvalidCertificate
  • InvalidSignature

Methods:

MethodSignatureDescription
isKind↗export fn (self: &TlsCertificateError) isKind(kind: TlsCertificateError): bool

TlsKeyScheduleError 🔓 export ​

📄 handshake.vx L21-32

vex
export enum TlsKeyScheduleError

Variants:

  • InvalidSecret
  • InvalidLabel
  • InvalidContext
  • InvalidOutput
  • BufferOverlap
  • InvalidState
  • HashMismatch
  • AuthenticationFailed
  • UnsupportedCipher
  • CryptoFailure

Methods:

MethodSignatureDescription
isKind↗export fn (self: &TlsKeyScheduleError) isKind(kind: TlsKeyScheduleError): bool

TlsHashAlgorithm 🔓 export ​

📄 handshake.vx L36-39

vex
export enum TlsHashAlgorithm

Hash identity is explicit at the HKDF boundary. TLS must never infer a

cryptographic algorithm from an output buffer or silently substitute one.

Variants:

  • Sha256
  • Sha384

Methods:

MethodSignatureDescription
digestLen↗export fn (self: &TlsHashAlgorithm) digestLen(): usize
maxExpandLen↗fn (self: &TlsHashAlgorithm) maxExpandLen(): usize

TlsHelloError 🔓 export ​

📄 hello.vx L41-54

vex
export enum TlsHelloError

Variants:

  • InvalidInput
  • InvalidOutput
  • InvalidMessageType
  • InvalidMessageLength
  • DecodeError
  • ProtocolVersion
  • IllegalParameter
  • MissingExtension
  • DuplicateExtension
  • ExtensionOrder
  • ResourceLimit
  • BufferOverlap

Methods:

MethodSignatureDescription
isKind↗export fn (self: &TlsHelloError) isKind(kind: TlsHelloError): bool

TlsDnsIdentityErrorKind 🔓 export ​

📄 hostname.vx L3-8

vex
export enum TlsDnsIdentityErrorKind

Variants:

  • InvalidReference
  • InvalidPresentedIdentity
  • UnsupportedIdna
  • IpAddressRequiresIpId

TlsSecretStage 🔓 export ​

📄 key_schedule.vx L13-18

vex
export enum TlsSecretStage

The only legal states of the TLS 1.3 main secret schedule.

Variants:

  • Early
  • Handshake
  • Master
  • Retired

TlsKeyUpdateRequest 🔓 export ​

📄 key_update.vx L9-12

vex
export enum TlsKeyUpdateRequest

Variants:

  • UpdateNotRequested
  • UpdateRequested

TlsKeyUpdateError 🔓 export ​

📄 key_update.vx L14-19

vex
export enum TlsKeyUpdateError

Variants:

  • InvalidBuffer
  • InvalidLength
  • InvalidMessageType
  • InvalidRequest

Methods:

MethodSignatureDescription
isKind↗export fn (self: &TlsKeyUpdateError) isKind(kind: TlsKeyUpdateError): bool

TlsHandshakeRole 🔓 export ​

📄 negotiation.vx L41-44

vex
export enum TlsHandshakeRole

Local endpoint role used to validate which Hello owns each X25519 share.

Variants:

  • Client
  • Server

TlsX25519NegotiationStage 🔓 export ​

📄 negotiation.vx L47-59

vex
export enum TlsX25519NegotiationStage

Monotonic state of normal no-PSK X25519 Hello negotiation.

Variants:

  • Ready
  • ClientHelloCommitted
  • HelloRetryRequested
  • RetryClientHelloCommitted
  • HandshakeTraffic
  • EncryptedExtensions
  • ServerCertificateAuthenticated
  • ServerCertificateVerifyAuthenticated
  • ServerFinishedAuthenticated
  • Complete
  • Failed

TlsX25519NegotiationError 🔓 export ​

📄 negotiation.vx L63-87

vex
export enum TlsX25519NegotiationError

Fail-closed negotiation errors. HelloRetryRequest is a typed transition

request, not a successful normal ServerHello.

Variants:

  • InvalidState
  • InvalidRole
  • InvalidPrivateKey
  • InvalidHello
  • InvalidEncryptedExtensions
  • ExtensionNotOffered
  • ResourceLimit
  • UnsupportedMode
  • UnsupportedCipher
  • CipherNotOffered
  • SessionMismatch
  • MissingKeyShare
  • KeyShareMismatch
  • HelloRetryRequest
  • InvalidOutput
  • BufferOverlap
  • NonContributoryKey
  • SignatureAlgorithmNotOffered
  • CertificateFailure
  • CertificateVerifyFailure
  • FinishedFailure
  • TranscriptFailure
  • ScheduleFailure

Methods:

MethodSignatureDescription
isKind↗export fn (self: &TlsX25519NegotiationError) isKind(kind: TlsX25519NegotiationError): bool

TlsRecordError 🔓 export ​

📄 record.vx L36-47

vex
export enum TlsRecordError

Allocation-free failures from TLS 1.3 record protection.

Variants:

  • InvalidState
  • InvalidKeyMaterial
  • InvalidBuffer
  • InvalidContentType
  • RecordOverflow
  • InvalidRecord
  • AuthenticationFailed
  • SequenceExhausted
  • BufferOverlap
  • CipherFailure

Methods:

MethodSignatureDescription
isKind↗export fn (self: &TlsRecordError) isKind(kind: TlsRecordError): bool

TlsTranscriptError 🔓 export ​

📄 transcript.vx L19-30

vex
export enum TlsTranscriptError

Allocation-free failures produced by the handshake framing and transcript

layer. Every validation error is detected before the hash state or counters are changed.

Variants:

  • InvalidLimit
  • InvalidInput
  • InvalidOutput
  • InvalidMessageLength
  • MessageTooLarge
  • TranscriptLimitExceeded
  • SyntheticMessageForbidden
  • InvalidState
  • HashUnavailable
  • HashFailure

Methods:

MethodSignatureDescription
isKind↗export fn (self: &TlsTranscriptError) isKind(kind: TlsTranscriptError): bool

TlsTransportState 🔓 export ​

📄 transport.vx L25-33

vex
export enum TlsTransportState

Variants:

  • Open
  • PeerCanceled
  • LocalCanceled
  • LocalCloseSent
  • PeerCloseReceived
  • Closed
  • Failed

TlsTransportEventKind 🔓 export ​

📄 transport.vx L35-42

vex
export enum TlsTransportEventKind

Variants:

  • ApplicationData
  • PeerCloseNotify
  • PeerUserCanceled
  • PeerFatalAlert
  • PostHandshakeFragment
  • PeerKeyUpdate

TlsTransportErrorKind 🔓 export ​

📄 transport.vx L52-60

vex
export enum TlsTransportErrorKind

Variants:

  • InvalidState
  • KeyScheduleFailure
  • RecordFailure
  • AlertFailure
  • KeyUpdateFailure
  • GenerationExhausted
  • UnexpectedMessage

X509ErrorKind 🔓 export ​

📄 x509.vx L25-44

vex
export enum X509ErrorKind

Variants:

  • InvalidDer
  • InvalidCertificate
  • UnsupportedAlgorithm
  • InvalidSignature
  • MissingSubjectAltName
  • InvalidSubjectAltName
  • InvalidValidity
  • CertificateNotYetValid
  • CertificateExpired
  • IssuerMismatch
  • NotCertificateAuthority
  • InvalidKeyUsage
  • InvalidExtendedKeyUsage
  • UnsupportedCriticalExtension
  • UnsupportedConstraint
  • ChainTooLong
  • HostnameMismatch
  • IndexOutOfBounds

Functions ​

alertLevelCode ​

📄 alert.vx L60-65

vex
fn alertLevelCode(level: TlsAlertLevel): u8

Parameters:

NameType
levelTlsAlertLevel

Returns: u8


decodeAlertLevel ​

📄 alert.vx L67-71

vex
fn decodeAlertLevel(code: u8): Result<TlsAlertLevel, TlsAlertError>

Parameters:

NameType
codeu8

Returns: Result<TlsAlertLevel, TlsAlertError>


alertDescriptionCode ​

📄 alert.vx L73-103

vex
fn alertDescriptionCode(description: TlsAlertDescription): u8

Parameters:

NameType
descriptionTlsAlertDescription

Returns: u8


decodeAlertDescription ​

📄 alert.vx L105-138

vex
fn decodeAlertDescription(code: u8): Result<TlsAlertDescription, TlsAlertError>

Parameters:

NameType
codeu8

Returns: Result<TlsAlertDescription, TlsAlertError>


canonicalAlertLevel ​

📄 alert.vx L140-147

vex
fn canonicalAlertLevel(description: TlsAlertDescription): TlsAlertLevel

Parameters:

NameType
descriptionTlsAlertDescription

Returns: TlsAlertLevel


encodeTlsAlert 🔓 export ​

📄 alert.vx L193-206

vex
export fn encodeTlsAlert(alert: TlsAlert, output: &Span<u8>!): Result<usize, TlsAlertError>

Encodes one canonical two-byte TLS 1.3 Alert payload. Vex never emits a

warning-level error alert or a fatal close_notify/user_canceled alert.

Parameters:

NameType
alertTlsAlert
output&Span<u8>!

Returns: Result<usize, TlsAlertError>


decodeTlsAlert 🔓 export ​

📄 alert.vx L211-227

vex
export fn decodeTlsAlert(input: Span<u8>): Result<TlsAlert, TlsAlertError>

Decodes exactly one Alert payload. Warning-level protocol errors are

retained on the view but isFatal still applies TLS 1.3 effective severity, preventing a peer-controlled downgrade.

Parameters:

NameType
inputSpan<u8>

Returns: Result<TlsAlert, TlsAlertError>


emptyFeedResult ​

📄 assembler.vx L60-68

vex
fn emptyFeedResult(consumed: usize): TlsHandshakeFeedResult

Parameters:

NameType
consumedusize

Returns: TlsHandshakeFeedResult


completeFeedResult ​

📄 assembler.vx L70-80

vex
fn completeFeedResult(kind: TlsHandshakeFeedKind, consumed: usize, header: TlsHandshakeHeader): TlsHandshakeFeedResult

Parameters:

NameType
kindTlsHandshakeFeedKind
consumedusize
headerTlsHandshakeHeader

Returns: TlsHandshakeFeedResult


copyBytes ​

📄 assembler.vx L82-89

vex
fn copyBytes(destination: Ptr<u8>, source: Ptr<u8>, length: usize)

Parameters:

NameType
destinationPtr<u8>
sourcePtr<u8>
lengthusize

spansOverlap ​

📄 assembler.vx L91-99

vex
fn spansOverlap(left: Span<u8>, right: Span<u8>): bool

Parameters:

NameType
leftSpan<u8>
rightSpan<u8>

Returns: bool


headerFromArray ​

📄 assembler.vx L101-109

vex
fn headerFromArray(value: &[u8; 4]): TlsHandshakeHeader

Parameters:

NameType
value&[u8; 4]

Returns: TlsHandshakeHeader


validateOutput ​

📄 assembler.vx L216-225

vex
fn validateOutput(output: Span<u8>, encodedLen: usize): Result<bool, TlsHandshakeAssemblerError>

Parameters:

NameType
outputSpan<u8>
encodedLenusize

Returns: Result<bool, TlsHandshakeAssemblerError>


headerFromSpan ​

📄 assembler.vx L227-239

vex
fn headerFromSpan(input: Span<u8>): Result<TlsHandshakeHeader, TlsHandshakeAssemblerError>

Parameters:

NameType
inputSpan<u8>

Returns: Result<TlsHandshakeHeader, TlsHandshakeAssemblerError>


certificateU16 ​

📄 certificate.vx L36-39

vex
fn certificateU16(input: Span<u8>, offset: usize): usize

Parameters:

NameType
inputSpan<u8>
offsetusize

Returns: usize


certificateU24 ​

📄 certificate.vx L41-45

vex
fn certificateU24(input: Span<u8>, offset: usize): usize

Parameters:

NameType
inputSpan<u8>
offsetusize

Returns: usize


certificateSlice ​

📄 certificate.vx L47-49

vex
fn certificateSlice(offset: usize, length: usize): TlsWireSlice

Parameters:

NameType
offsetusize
lengthusize

Returns: TlsWireSlice


scanCertificateEntryExtensions ​

📄 certificate.vx L51-84

vex
fn scanCertificateEntryExtensions(input: Span<u8>, offset: usize, length: usize): Result<usize, TlsCertificateError>

Parameters:

NameType
inputSpan<u8>
offsetusize
lengthusize

Returns: Result<usize, TlsCertificateError>


certificateEntryAtChecked ​

📄 certificate.vx L99-141

vex
fn certificateEntryAtChecked(encoded: Span<u8>, list: &TlsWireSlice, wanted: usize): Result<TlsCertificateEntryView, TlsCertificateError>

Parameters:

NameType
encodedSpan<u8>
list&TlsWireSlice
wantedusize

Returns: Result<TlsCertificateEntryView, TlsCertificateError>


decodeServerCertificate 🔓 export ​

📄 certificate.vx L155-219

vex
export fn decodeServerCertificate(encoded: Span<u8>): Result<TlsCertificateMessageView, TlsCertificateError>

Decodes one complete server Certificate Handshake message. The server

request context must be empty; the list is bounded to leaf plus eight intermediates and all entry extension vectors are structurally validated.

Parameters:

NameType
encodedSpan<u8>

Returns: Result<TlsCertificateMessageView, TlsCertificateError>


decodeCertificateVerify 🔓 export ​

📄 certificate.vx L227-252

vex
export fn decodeCertificateVerify(encoded: Span<u8>): Result<TlsCertificateVerifyView, TlsCertificateError>

Parameters:

NameType
encodedSpan<u8>

Returns: Result<TlsCertificateVerifyView, TlsCertificateError>


verifyServerCertificateSignature 🔓 export ​

📄 certificate.vx L257-269

vex
export fn verifyServerCertificateSignature(encoded: Span<u8>, transcript: &TlsTranscript, leafDer: Span<u8>): Result<bool, TlsCertificateError>

Verifies a server CertificateVerify against the transcript ending at the

complete Certificate message. The CertificateVerify message is not appended here; the owning handshake state may commit it only after success.

Parameters:

NameType
encodedSpan<u8>
transcript&TlsTranscript
leafDerSpan<u8>

Returns: Result<bool, TlsCertificateError>


verifyServerCertificateSignatureWithKey 🔓 export ​

📄 certificate.vx L275-327

vex
export fn verifyServerCertificateSignatureWithKey(encoded: Span<u8>, transcript: &TlsTranscript, publicKey: Span<u8>): Result<bool, TlsCertificateError>

Verifies server CertificateVerify with an exact Ed25519 public key already

authenticated by an owning certificate-path state. This avoids retaining a borrowed DER span across handshake calls while keeping the RFC 8446 context construction and signature checks in one source of truth.

Parameters:

NameType
encodedSpan<u8>
transcript&TlsTranscript
publicKeySpan<u8>

Returns: Result<bool, TlsCertificateError>


spansOverlap ​

📄 handshake.vx L62-70

vex
fn spansOverlap(left: Span<u8>, right: Span<u8>): bool

Parameters:

NameType
leftSpan<u8>
rightSpan<u8>

Returns: bool


hkdfExpandLabel 🔓 export ​

📄 handshake.vx L77-161

vex
export fn hkdfExpandLabel(hash: TlsHashAlgorithm, secret: Span<u8>, label: str, context: Span<u8>, out: &Span<u8>!): Result<usize, TlsKeyScheduleError>

RFC 8446 HKDF-Expand-Label for TLS 1.3 SHA-256 and SHA-384 schedules.

The traffic secret must be exactly one digest of the selected hash. The output length comes from the mutable span, preventing pointer/length disagreement. Inputs may not alias output; rejection precedes mutation.

Parameters:

NameType
hashTlsHashAlgorithm
secretSpan<u8>
labelstr
contextSpan<u8>
out&Span<u8>!

Returns: Result<usize, TlsKeyScheduleError>


deriveSecret 🔓 export ​

📄 handshake.vx L168-181

vex
export fn deriveSecret(hash: TlsHashAlgorithm, secret: Span<u8>, label: str, transcriptHash: Span<u8>, out: &Span<u8>!): Result<usize, TlsKeyScheduleError>

RFC 8446 Derive-Secret over an already snapshotted transcript hash.

Requiring one exact digest for both secret and transcriptHash prevents accidental cross-suite derivation. The output prefix is committed only after every length and alias check succeeds.

Parameters:

NameType
hashTlsHashAlgorithm
secretSpan<u8>
labelstr
transcriptHashSpan<u8>
out&Span<u8>!

Returns: Result<usize, TlsKeyScheduleError>


computeFinishedVerifyData 🔓 export ​

📄 handshake.vx L185-232

vex
export fn computeFinishedVerifyData(hash: TlsHashAlgorithm, baseKey: Span<u8>, transcriptHash: Span<u8>, out: &Span<u8>!): Result<usize, TlsKeyScheduleError>

Computes TLS 1.3 Finished.verify_data from a traffic secret and an exact

transcript snapshot. The caller must snapshot before appending Finished.

Parameters:

NameType
hashTlsHashAlgorithm
baseKeySpan<u8>
transcriptHashSpan<u8>
out&Span<u8>!

Returns: Result<usize, TlsKeyScheduleError>


verifyFinished 🔓 export ​

📄 handshake.vx L236-264

vex
export fn verifyFinished(hash: TlsHashAlgorithm, baseKey: Span<u8>, transcriptHash: Span<u8>, received: Span<u8>): Result<bool, TlsKeyScheduleError>

Verifies TLS 1.3 Finished in constant time. A mismatch is an authentication

failure, not a boolean that a caller can accidentally ignore.

Parameters:

NameType
hashTlsHashAlgorithm
baseKeySpan<u8>
transcriptHashSpan<u8>
receivedSpan<u8>

Returns: Result<bool, TlsKeyScheduleError>


deriveTrafficKeys 🔓 export ​

📄 handshake.vx L268-308

vex
export fn deriveTrafficKeys(secret: Span<u8>, cipherId: u16, outKey: &Span<u8>!, outIv: &Span<u8>!): Result<TlsTrafficKeyLengths, TlsKeyScheduleError>

Derive the per-direction TLS 1.3 record key and IV for all implemented

suites. Cipher-suite selection fixes both AEAD key length and HKDF hash.

Parameters:

NameType
secretSpan<u8>
cipherIdu16
outKey&Span<u8>!
outIv&Span<u8>!

Returns: Result<TlsTrafficKeyLengths, TlsKeyScheduleError>


updateTrafficSecret 🔓 export ​

📄 handshake.vx L315-329

vex
export fn updateTrafficSecret(hash: TlsHashAlgorithm, current: Span<u8>, next: &Span<u8>!): Result<usize, TlsKeyScheduleError>

Derives RFC 8446 application_traffic_secret_N+1 from generation N.

The current secret remains caller-owned and unchanged. The next secret is committed only after exact hash-width, capacity and alias validation, so a transport can stage the complete next key generation before publishing it.

Parameters:

NameType
hashTlsHashAlgorithm
currentSpan<u8>
next&Span<u8>!

Returns: Result<usize, TlsKeyScheduleError>


emptyWireSlice ​

📄 hello.vx L70-76

vex
fn emptyWireSlice(): TlsWireSlice

Returns: TlsWireSlice


emptyExtensions ​

📄 hello.vx L105-119

vex
fn emptyExtensions(): TlsHelloExtensions

Returns: TlsHelloExtensions


readU16 ​

📄 hello.vx L384-387

vex
fn readU16(input: Span<u8>, offset: usize): u16

Parameters:

NameType
inputSpan<u8>
offsetusize

Returns: u16


writeU16 ​

📄 hello.vx L389-393

vex
fn writeU16(output: &Span<u8>!, offset: usize, value: u16)

Parameters:

NameType
output&Span<u8>!
offsetusize
valueu16

copyBytes ​

📄 hello.vx L395-398

vex
fn copyBytes(destination: Ptr<u8>, source: Ptr<u8>, length: usize)

Parameters:

NameType
destinationPtr<u8>
sourcePtr<u8>
lengthusize

rangesOverlap ​

📄 hello.vx L400-408

vex
fn rangesOverlap(leftAddress: usize, leftLen: usize, rightAddress: usize, rightLen: usize): bool

Parameters:

NameType
leftAddressusize
leftLenusize
rightAddressusize
rightLenusize

Returns: bool


spanRangeOverlapsOutput ​

📄 hello.vx L410-415

vex
fn spanRangeOverlapsOutput(input: Span<u8>, output: Span<u8>, used: usize): bool

Parameters:

NameType
inputSpan<u8>
outputSpan<u8>
usedusize

Returns: bool


validateVector16 ​

📄 hello.vx L417-430

vex
fn validateVector16(input: Span<u8>, offset: usize, length: usize, maxItems: usize): Result<usize, TlsHelloError>

Parameters:

NameType
inputSpan<u8>
offsetusize
lengthusize
maxItemsusize

Returns: Result<usize, TlsHelloError>


validateSupportedVersions ​

📄 hello.vx L432-459

vex
fn validateSupportedVersions(input: Span<u8>, view: TlsWireSlice, client: bool): Result<bool, TlsHelloError>

Parameters:

NameType
inputSpan<u8>
viewTlsWireSlice
clientbool

Returns: Result<bool, TlsHelloError>


validateServerName ​

📄 hello.vx L461-495

vex
fn validateServerName(input: Span<u8>, view: TlsWireSlice): Result<bool, TlsHelloError>

Parameters:

NameType
inputSpan<u8>
viewTlsWireSlice

Returns: Result<bool, TlsHelloError>


validateAlpn ​

📄 hello.vx L497-519

vex
fn validateAlpn(input: Span<u8>, view: TlsWireSlice): Result<bool, TlsHelloError>

Parameters:

NameType
inputSpan<u8>
viewTlsWireSlice

Returns: Result<bool, TlsHelloError>


validateCookie ​

📄 hello.vx L521-532

vex
fn validateCookie(input: Span<u8>, view: TlsWireSlice): Result<bool, TlsHelloError>

Parameters:

NameType
inputSpan<u8>
viewTlsWireSlice

Returns: Result<bool, TlsHelloError>


validatePadding ​

📄 hello.vx L534-545

vex
fn validatePadding(input: Span<u8>, view: TlsWireSlice): Result<bool, TlsHelloError>

Parameters:

NameType
inputSpan<u8>
viewTlsWireSlice

Returns: Result<bool, TlsHelloError>


validateClientPsk ​

📄 hello.vx L547-592

vex
fn validateClientPsk(input: Span<u8>, view: TlsWireSlice): Result<bool, TlsHelloError>

Parameters:

NameType
inputSpan<u8>
viewTlsWireSlice

Returns: Result<bool, TlsHelloError>


groupsContain ​

📄 hello.vx L594-602

vex
fn groupsContain(input: Span<u8>, view: TlsWireSlice, group: u16): bool

Parameters:

NameType
inputSpan<u8>
viewTlsWireSlice
groupu16

Returns: bool


validateClientKeyShares ​

📄 hello.vx L604-640

vex
fn validateClientKeyShares(input: Span<u8>, view: TlsWireSlice, groups: TlsWireSlice): Result<bool, TlsHelloError>

Parameters:

NameType
inputSpan<u8>
viewTlsWireSlice
groupsTlsWireSlice

Returns: Result<bool, TlsHelloError>


validateServerKeyShare ​

📄 hello.vx L642-655

vex
fn validateServerKeyShare(input: Span<u8>, view: TlsWireSlice, helloRetryRequest: bool): Result<bool, TlsHelloError>

Parameters:

NameType
inputSpan<u8>
viewTlsWireSlice
helloRetryRequestbool

Returns: Result<bool, TlsHelloError>


scanExtensions ​

📄 hello.vx L657-854

vex
fn scanExtensions(input: Span<u8>, start: usize, length: usize, client: bool, helloRetryRequest: bool): Result<TlsHelloExtensions, TlsHelloError>

Parameters:

NameType
inputSpan<u8>
startusize
lengthusize
clientbool
helloRetryRequestbool

Returns: Result<TlsHelloExtensions, TlsHelloError>


decodeExactHeader ​

📄 hello.vx L856-876

vex
fn decodeExactHeader(encoded: Span<u8>, expectedType: u8): Result<TlsHandshakeHeader, TlsHelloError>

Parameters:

NameType
encodedSpan<u8>
expectedTypeu8

Returns: Result<TlsHandshakeHeader, TlsHelloError>


copyRandom ​

📄 hello.vx L878-886

vex
fn copyRandom(input: Span<u8>, offset: usize): [u8; 32]

Parameters:

NameType
inputSpan<u8>
offsetusize

Returns: [u8; 32]


isHelloRetryRandom ​

📄 hello.vx L888-896

vex
fn isHelloRetryRandom(random: &[u8; 32]): bool

Parameters:

NameType
random&[u8; 32]

Returns: bool


decodeClientHello 🔓 export ​

📄 hello.vx L899-960

vex
export fn decodeClientHello(encoded: Span<u8>): Result<TlsClientHelloView, TlsHelloError>

Decodes and validates one complete TLS 1.3 ClientHello Handshake message.

Parameters:

NameType
encodedSpan<u8>

Returns: Result<TlsClientHelloView, TlsHelloError>


decodeServerHello 🔓 export ​

📄 hello.vx L964-1013

vex
export fn decodeServerHello(encoded: Span<u8>): Result<TlsServerHelloView, TlsHelloError>

Decodes and validates one complete TLS 1.3 ServerHello or

HelloRetryRequest Handshake message.

Parameters:

NameType
encodedSpan<u8>

Returns: Result<TlsServerHelloView, TlsHelloError>


encodeHeader ​

📄 hello.vx L1015-1027

vex
fn encodeHeader(messageType: u8, bodyLen: usize, output: &Span<u8>!): Result<bool, TlsHelloError>

Parameters:

NameType
messageTypeu8
bodyLenusize
output&Span<u8>!

Returns: Result<bool, TlsHelloError>


encodeTlsExtension 🔓 export ​

📄 hello.vx L1030-1047

vex
export fn encodeTlsExtension(extensionType: u16, data: Span<u8>, output: &Span<u8>!): Result<usize, TlsHelloError>

Emits a generic Extension TLV into caller-owned storage.

Parameters:

NameType
extensionTypeu16
dataSpan<u8>
output&Span<u8>!

Returns: Result<usize, TlsHelloError>


encodeCookie 🔓 export ​

📄 hello.vx L1052-1074

vex
export fn encodeCookie(cookie: Span<u8>, output: &Span<u8>!): Result<usize, TlsHelloError>

Encodes the TLS 1.3 cookie extension into caller-owned storage. The

opaque payload is length-delimited exactly once inside the extension and is never allocated or truncated.

Parameters:

NameType
cookieSpan<u8>
output&Span<u8>!

Returns: Result<usize, TlsHelloError>


encodeClientHello 🔓 export ​

📄 hello.vx L1079-1146

vex
export fn encodeClientHello(random: &[u8; 32], sessionId: Span<u8>, cipherSuites: Span<u16>, extensionBlock: Span<u8>, output: &Span<u8>!): Result<usize, TlsHelloError>

Emits the TLS 1.3 ClientHello body and Handshake header. Randomness and key

material are always supplied by the caller; this codec has no deterministic or hidden entropy fallback.

Parameters:

NameType
random&[u8; 32]
sessionIdSpan<u8>
cipherSuitesSpan<u16>
extensionBlockSpan<u8>
output&Span<u8>!

Returns: Result<usize, TlsHelloError>


encodeServerHello 🔓 export ​

📄 hello.vx L1150-1205

vex
export fn encodeServerHello(random: &[u8; 32], sessionId: Span<u8>, cipherSuite: u16, extensionBlock: Span<u8>, output: &Span<u8>!): Result<usize, TlsHelloError>

Emits one TLS 1.3 ServerHello or HelloRetryRequest from an already

validated extension block.

Parameters:

NameType
random&[u8; 32]
sessionIdSpan<u8>
cipherSuiteu16
extensionBlockSpan<u8>
output&Span<u8>!

Returns: Result<usize, TlsHelloError>


encodeClientSupportedVersions 🔓 export ​

📄 hello.vx L1208-1245

vex
export fn encodeClientSupportedVersions(versions: Span<u16>, output: &Span<u8>!): Result<usize, TlsHelloError>

Encodes supported_versions for a TLS 1.3 ClientHello.

Parameters:

NameType
versionsSpan<u16>
output&Span<u8>!

Returns: Result<usize, TlsHelloError>


encodeServerSupportedVersion 🔓 export ​

📄 hello.vx L1247-1257

vex
export fn encodeServerSupportedVersion(output: &Span<u8>!): Result<usize, TlsHelloError>

Parameters:

NameType
output&Span<u8>!

Returns: Result<usize, TlsHelloError>


encodeU16VectorExtension ​

📄 hello.vx L1259-1287

vex
fn encodeU16VectorExtension(extensionType: u16, values: Span<u16>, maxItems: usize, output: &Span<u8>!): Result<usize, TlsHelloError>

Parameters:

NameType
extensionTypeu16
valuesSpan<u16>
maxItemsusize
output&Span<u8>!

Returns: Result<usize, TlsHelloError>


encodeSupportedGroups 🔓 export ​

📄 hello.vx L1289-1295

vex
export fn encodeSupportedGroups(groups: Span<u16>, output: &Span<u8>!): Result<usize, TlsHelloError>

Parameters:

NameType
groupsSpan<u16>
output&Span<u8>!

Returns: Result<usize, TlsHelloError>


encodeSignatureAlgorithms 🔓 export ​

📄 hello.vx L1297-1304

vex
export fn encodeSignatureAlgorithms(schemes: Span<u16>, output: &Span<u8>!): Result<usize, TlsHelloError>

Parameters:

NameType
schemesSpan<u16>
output&Span<u8>!

Returns: Result<usize, TlsHelloError>


encodeClientKeyShare 🔓 export ​

📄 hello.vx L1306-1330

vex
export fn encodeClientKeyShare(group: u16, keyExchange: Span<u8>, output: &Span<u8>!): Result<usize, TlsHelloError>

Parameters:

NameType
groupu16
keyExchangeSpan<u8>
output&Span<u8>!

Returns: Result<usize, TlsHelloError>


encodeServerKeyShare 🔓 export ​

📄 hello.vx L1332-1355

vex
export fn encodeServerKeyShare(group: u16, keyExchange: Span<u8>, output: &Span<u8>!): Result<usize, TlsHelloError>

Parameters:

NameType
groupu16
keyExchangeSpan<u8>
output&Span<u8>!

Returns: Result<usize, TlsHelloError>


encodeHelloRetryKeyShare 🔓 export ​

📄 hello.vx L1359-1369

vex
export fn encodeHelloRetryKeyShare(group: u16, output: &Span<u8>!): Result<usize, TlsHelloError>

Encodes the selected-group-only key_share form used exclusively by

HelloRetryRequest. A normal ServerHello must use encodeServerKeyShare.

Parameters:

NameType
groupu16
output&Span<u8>!

Returns: Result<usize, TlsHelloError>


identityError ​

📄 hostname.vx L27-29

vex
fn identityError(kind: TlsDnsIdentityErrorKind, offset: usize): TlsDnsIdentityError

Parameters:

NameType
kindTlsDnsIdentityErrorKind
offsetusize

Returns: TlsDnsIdentityError


identityByteAt ​

📄 hostname.vx L31-33

vex
fn identityByteAt(value: Span<u8>, offset: usize): u8

Parameters:

NameType
valueSpan<u8>
offsetusize

Returns: u8


isAsciiAlpha ​

📄 hostname.vx L35-38

vex
fn isAsciiAlpha(value: u8): bool

Parameters:

NameType
valueu8

Returns: bool


isAsciiDigit ​

📄 hostname.vx L40-42

vex
fn isAsciiDigit(value: u8): bool

Parameters:

NameType
valueu8

Returns: bool


foldedAscii ​

📄 hostname.vx L44-47

vex
fn foldedAscii(value: u8): u8

Parameters:

NameType
valueu8

Returns: u8


normalizedDnsLength ​

📄 hostname.vx L49-97

vex
fn normalizedDnsLength(value: Span<u8>, allowWildcard: bool, invalidKind: TlsDnsIdentityErrorKind): Result<usize, TlsDnsIdentityError>

Parameters:

NameType
valueSpan<u8>
allowWildcardbool
invalidKindTlsDnsIdentityErrorKind

Returns: Result<usize, TlsDnsIdentityError>


isIpv4Reference ​

📄 hostname.vx L99-121

vex
fn isIpv4Reference(value: Span<u8>, length: usize): bool

Parameters:

NameType
valueSpan<u8>
lengthusize

Returns: bool


equalDnsRange ​

📄 hostname.vx L123-137

vex
fn equalDnsRange(reference: Span<u8>, referenceOffset: usize, presented: Span<u8>, presentedOffset: usize, length: usize): bool

Parameters:

NameType
referenceSpan<u8>
referenceOffsetusize
presentedSpan<u8>
presentedOffsetusize
lengthusize

Returns: bool


sameHash ​

📄 key_schedule.vx L20-31

vex
fn sameHash(left: TlsHashAlgorithm, right: TlsHashAlgorithm): bool

Parameters:

NameType
leftTlsHashAlgorithm
rightTlsHashAlgorithm

Returns: bool


rangesOverlap ​

📄 key_schedule.vx L33-41

vex
fn rangesOverlap(left: Span<u8>, right: Span<u8>): bool

Parameters:

NameType
leftSpan<u8>
rightSpan<u8>

Returns: bool


exactArraySpan ​

📄 key_schedule.vx L43-45

vex
fn exactArraySpan(value: &[u8; 48], length: usize): Span<u8>

Parameters:

NameType
value&[u8; 48]
lengthusize

Returns: Span<u8>


exactArraySpanMut ​

📄 key_schedule.vx L47-49

vex
fn exactArraySpanMut(value: &[u8; 48]!, length: usize): Span<u8>

Parameters:

NameType
value&[u8; 48]!
lengthusize

Returns: Span<u8>


emptyTranscriptHash ​

📄 key_schedule.vx L51-69

vex
fn emptyTranscriptHash(hash: TlsHashAlgorithm): [u8; 48]

Parameters:

NameType
hashTlsHashAlgorithm

Returns: [u8; 48]


transcriptDigest ​

📄 key_schedule.vx L71-87

vex
fn transcriptDigest(hash: TlsHashAlgorithm, transcript: &TlsTranscript, output: &[u8; 48]!): Result<usize, TlsKeyScheduleError>

Parameters:

NameType
hashTlsHashAlgorithm
transcript&TlsTranscript
output&[u8; 48]!

Returns: Result<usize, TlsKeyScheduleError>


extractSecret ​

📄 key_schedule.vx L89-108

vex
fn extractSecret(hash: TlsHashAlgorithm, salt: Span<u8>, ikm: Span<u8>, output: Ptr<u8>): bool

Parameters:

NameType
hashTlsHashAlgorithm
saltSpan<u8>
ikmSpan<u8>
outputPtr<u8>

Returns: bool


validateDualOutput ​

📄 key_schedule.vx L110-126

vex
fn validateDualOutput(digestLen: usize, first: Span<u8>, second: Span<u8>, input: Span<u8>): Result<bool, TlsKeyScheduleError>

Parameters:

NameType
digestLenusize
firstSpan<u8>
secondSpan<u8>
inputSpan<u8>

Returns: Result<bool, TlsKeyScheduleError>


computeFinishedFromTranscript 🔓 export ​

📄 key_schedule.vx L394-414

vex
export fn computeFinishedFromTranscript(baseKey: Span<u8>, transcript: &TlsTranscript, out: &Span<u8>!): Result<usize, TlsKeyScheduleError>

Transcript-coupled Finished generation. The selected transcript hash is

authoritative; caller-provided hash identity cannot drift from it.

Parameters:

NameType
baseKeySpan<u8>
transcript&TlsTranscript
out&Span<u8>!

Returns: Result<usize, TlsKeyScheduleError>


verifyFinishedFromTranscript 🔓 export ​

📄 key_schedule.vx L418-438

vex
export fn verifyFinishedFromTranscript(baseKey: Span<u8>, transcript: &TlsTranscript, received: Span<u8>): Result<bool, TlsKeyScheduleError>

Transcript-coupled constant-time Finished verification. Verify before

appending the peer Finished message to the transcript.

Parameters:

NameType
baseKeySpan<u8>
transcript&TlsTranscript
receivedSpan<u8>

Returns: Result<bool, TlsKeyScheduleError>


keyUpdateRequestCode ​

📄 key_update.vx L25-30

vex
fn keyUpdateRequestCode(request: TlsKeyUpdateRequest): u8

Parameters:

NameType
requestTlsKeyUpdateRequest

Returns: u8


encodeTlsKeyUpdate 🔓 export ​

📄 key_update.vx L33-46

vex
export fn encodeTlsKeyUpdate(request: TlsKeyUpdateRequest, output: &Span<u8>!): Result<usize, TlsKeyUpdateError>

Encodes one complete Handshake-framed TLS 1.3 KeyUpdate message.

Parameters:

NameType
requestTlsKeyUpdateRequest
output&Span<u8>!

Returns: Result<usize, TlsKeyUpdateError>


decodeTlsKeyUpdate 🔓 export ​

📄 key_update.vx L51-78

vex
export fn decodeTlsKeyUpdate(encoded: Span<u8>): Result<TlsKeyUpdateRequest, TlsKeyUpdateError>

Decodes exactly one complete Handshake-framed TLS 1.3 KeyUpdate message.

Values other than 0 and 1 are retained as a typed InvalidRequest so the connection owner can select the required illegal_parameter alert.

Parameters:

NameType
encodedSpan<u8>

Returns: Result<TlsKeyUpdateRequest, TlsKeyUpdateError>


exactArraySpan ​

📄 negotiation.vx L95-97

vex
fn exactArraySpan<const N: usize>(value: &[u8; N], length: usize): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]
lengthusize

Returns: Span<u8>


exactArraySpanMut ​

📄 negotiation.vx L99-101

vex
fn exactArraySpanMut<const N: usize>(value: &[u8; N]!, length: usize): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!
lengthusize

Returns: Span<u8>


spansOverlap ​

📄 negotiation.vx L103-111

vex
fn spansOverlap(left: Span<u8>, right: Span<u8>): bool

Parameters:

NameType
leftSpan<u8>
rightSpan<u8>

Returns: bool


equalBytes ​

📄 negotiation.vx L113-120

vex
fn equalBytes(left: Span<u8>, right: Span<u8>): bool

Parameters:

NameType
leftSpan<u8>
rightSpan<u8>

Returns: bool


mapHelloFailure ​

📄 negotiation.vx L122-124

vex
fn mapHelloFailure(_: TlsHelloError): TlsX25519NegotiationError

Parameters:

NameType
_TlsHelloError

Returns: TlsX25519NegotiationError


mapTranscriptFailure ​

📄 negotiation.vx L126-128

vex
fn mapTranscriptFailure(_: TlsTranscriptError): TlsX25519NegotiationError

Parameters:

NameType
_TlsTranscriptError

Returns: TlsX25519NegotiationError


mapScheduleFailure ​

📄 negotiation.vx L130-138

vex
fn mapScheduleFailure(failure: TlsKeyScheduleError): TlsX25519NegotiationError

Parameters:

NameType
failureTlsKeyScheduleError

Returns: TlsX25519NegotiationError


cipherHash ​

📄 negotiation.vx L140-150

vex
fn cipherHash(cipherSuite: u16): Result<TlsHashAlgorithm, TlsX25519NegotiationError>

Parameters:

NameType
cipherSuiteu16

Returns: Result<TlsHashAlgorithm, TlsX25519NegotiationError>


offeredCipher ​

📄 negotiation.vx L328-338

vex
fn offeredCipher(view: &TlsClientHelloView, encoded: Span<u8>, cipher: u16): bool

Parameters:

NameType
view&TlsClientHelloView
encodedSpan<u8>
cipheru16

Returns: bool


offeredSignature ​

📄 negotiation.vx L340-353

vex
fn offeredSignature(view: &TlsClientHelloView, encoded: Span<u8>, scheme: u16): Result<bool, TlsX25519NegotiationError>

Parameters:

NameType
view&TlsClientHelloView
encodedSpan<u8>
schemeu16

Returns: Result<bool, TlsX25519NegotiationError>


hashU16 ​

📄 negotiation.vx L355-363

vex
fn hashU16(hasher: &Sha256!, value: usize)

Parameters:

NameType
hasher&Sha256!
valueusize

retryInvariantDigest ​

📄 negotiation.vx L370-433

vex
fn retryInvariantDigest(view: &TlsClientHelloView, encoded: Span<u8>, output: &[u8; 32]!): Result<bool, TlsX25519NegotiationError>

Hashes precisely the ClientHello fields RFC 8446 requires to remain

invariant across HelloRetryRequest. key_share, cookie, and zero padding are excluded because the protocol explicitly permits those fields to change. The digest is an internal comparison token, never a transcript substitute.

Parameters:

NameType
view&TlsClientHelloView
encodedSpan<u8>
output&[u8; 32]!

Returns: Result<bool, TlsX25519NegotiationError>


extensionPresent ​

📄 negotiation.vx L435-443

vex
fn extensionPresent(view: &TlsClientHelloView, encoded: Span<u8>, identity: u16): Result<bool, TlsX25519NegotiationError>

Parameters:

NameType
view&TlsClientHelloView
encodedSpan<u8>
identityu16

Returns: Result<bool, TlsX25519NegotiationError>


validateTrafficOutputs ​

📄 negotiation.vx L809-821

vex
fn validateTrafficOutputs(digestLen: usize, clientOut: Span<u8>, serverOut: Span<u8>): Result<bool, TlsX25519NegotiationError>

Parameters:

NameType
digestLenusize
clientOutSpan<u8>
serverOutSpan<u8>

Returns: Result<bool, TlsX25519NegotiationError>


negotiationU16 ​

📄 negotiation.vx L1105-1108

vex
fn negotiationU16(input: Span<u8>, offset: usize): usize

Parameters:

NameType
inputSpan<u8>
offsetusize

Returns: usize


encodeRecordHeaderRaw ​

📄 record.vx L60-66

vex
fn encodeRecordHeaderRaw(contentType: u8, version: u16, length: u16, out: RawBuf)

Parameters:

NameType
contentTypeu8
versionu16
lengthu16
outRawBuf

decodeRecordHeaderRaw ​

📄 record.vx L68-79

vex
fn decodeRecordHeaderRaw(inBuf: RawBuf): TlsRecordHeader

Parameters:

NameType
inBufRawBuf

Returns: TlsRecordHeader


encodeRecordHeader 🔓 export ​

📄 record.vx L207-217

vex
export fn encodeRecordHeader(contentType: u8, version: u16, length: u16, out: &Span<u8>!): Result<usize, TlsRecordError>

Parameters:

NameType
contentTypeu8
versionu16
lengthu16
out&Span<u8>!

Returns: Result<usize, TlsRecordError>


decodeRecordHeader 🔓 export ​

📄 record.vx L219-224

vex
export fn decodeRecordHeader(inBuf: Span<u8>): Result<TlsRecordHeader, TlsRecordError>

Parameters:

NameType
inBufSpan<u8>

Returns: Result<TlsRecordHeader, TlsRecordError>


isTlsInnerContentType ​

📄 record.vx L226-231

vex
fn isTlsInnerContentType(contentType: u8): bool

Parameters:

NameType
contentTypeu8

Returns: bool


rangesOverlap ​

📄 record.vx L233-241

vex
fn rangesOverlap(a: RawBuf, aLen: u64, b: RawBuf, bLen: u64): bool

Parameters:

NameType
aRawBuf
aLenu64
bRawBuf
bLenu64

Returns: bool


constructNonce ​

📄 record.vx L243-259

vex
fn constructNonce(iv: RawBuf, seq: u64, outNonce: RawBuf)

Parameters:

NameType
ivRawBuf
sequ64
outNonceRawBuf

decodeHeaderRaw ​

📄 transcript.vx L44-52

vex
fn decodeHeaderRaw(input: RawBuf): TlsHandshakeHeader

Parameters:

NameType
inputRawBuf

Returns: TlsHandshakeHeader


encodeHeaderRaw ​

📄 transcript.vx L54-59

vex
fn encodeHeaderRaw(header: TlsHandshakeHeader, output: RawBuf)

Parameters:

NameType
headerTlsHandshakeHeader
outputRawBuf

decodeHandshakeHeader 🔓 export ​

📄 transcript.vx L62-69

vex
export fn decodeHandshakeHeader(input: Span<u8>): Result<TlsHandshakeHeader, TlsTranscriptError>

Decodes a TLS Handshake header from the first four bytes of input.

Parameters:

NameType
inputSpan<u8>

Returns: Result<TlsHandshakeHeader, TlsTranscriptError>


encodeHandshakeHeader 🔓 export ​

📄 transcript.vx L72-83

vex
export fn encodeHandshakeHeader(header: TlsHandshakeHeader, output: &Span<u8>!): Result<usize, TlsTranscriptError>

Encodes a TLS Handshake header without allocating.

Parameters:

NameType
headerTlsHandshakeHeader
output&Span<u8>!

Returns: Result<usize, TlsTranscriptError>


sameHash ​

📄 transcript.vx L212-223

vex
fn sameHash(left: TlsHashAlgorithm, right: TlsHashAlgorithm): bool

Parameters:

NameType
leftTlsHashAlgorithm
rightTlsHashAlgorithm

Returns: bool


transportError ​

📄 transport.vx L78-86

vex
fn transportError(kind: TlsTransportErrorKind): TlsTransportError

Parameters:

NameType
kindTlsTransportErrorKind

Returns: TlsTransportError


transportRecordError ​

📄 transport.vx L88-96

vex
fn transportRecordError(cause: TlsRecordError): TlsTransportError

Parameters:

NameType
causeTlsRecordError

Returns: TlsTransportError


transportAlertError ​

📄 transport.vx L98-106

vex
fn transportAlertError(cause: TlsAlertError): TlsTransportError

Parameters:

NameType
causeTlsAlertError

Returns: TlsTransportError


transportScheduleError ​

📄 transport.vx L108-116

vex
fn transportScheduleError(cause: TlsKeyScheduleError): TlsTransportError

Parameters:

NameType
causeTlsKeyScheduleError

Returns: TlsTransportError


transportKeyUpdateError ​

📄 transport.vx L118-126

vex
fn transportKeyUpdateError(cause: TlsKeyUpdateError): TlsTransportError

Parameters:

NameType
causeTlsKeyUpdateError

Returns: TlsTransportError


recordFailureEndsConnection ​

📄 transport.vx L128-141

vex
fn recordFailureEndsConnection(cause: TlsRecordError): bool

Parameters:

NameType
causeTlsRecordError

Returns: bool


arraySpan ​

📄 transport.vx L143-145

vex
fn arraySpan<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


mutableArraySpan ​

📄 transport.vx L147-149

vex
fn mutableArraySpan<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


stageNextGeneration ​

📄 transport.vx L327-353

vex
fn stageNextGeneration(hash: TlsHashAlgorithm, cipherId: u16, digestLen: usize, currentSecret: Span<u8>): Result<TlsNextTrafficGeneration, TlsTransportError>

Parameters:

NameType
hashTlsHashAlgorithm
cipherIdu16
digestLenusize
currentSecretSpan<u8>

Returns: Result<TlsNextTrafficGeneration, TlsTransportError>


x509Error ​

📄 x509.vx L56-58

vex
fn x509Error(kind: X509ErrorKind, offset: usize): X509Error

Parameters:

NameType
kindX509ErrorKind
offsetusize

Returns: X509Error


bytesOf ​

📄 x509.vx L60-62

vex
fn bytesOf<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


rebaseSlice ​

📄 x509.vx L64-66

vex
fn rebaseSlice(value: DerSlice, base: usize): DerSlice

Parameters:

NameType
valueDerSlice
baseusize

Returns: DerSlice


rebaseElement ​

📄 x509.vx L68-77

vex
fn rebaseElement(value: DerElement, base: usize): DerElement

Parameters:

NameType
valueDerElement
baseusize

Returns: DerElement


child ​

📄 x509.vx L79-84

vex
fn child(input: Span<u8>, parent: &DerElement, index: usize): Result<DerElement, X509Error>

Parameters:

NameType
inputSpan<u8>
parent&DerElement
indexusize

Returns: Result<DerElement, X509Error>


childCount ​

📄 x509.vx L86-91

vex
fn childCount(input: Span<u8>, parent: &DerElement): Result<usize, X509Error>

Parameters:

NameType
inputSpan<u8>
parent&DerElement

Returns: Result<usize, X509Error>


isEd25519Algorithm ​

📄 x509.vx L93-111

vex
fn isEd25519Algorithm(input: Span<u8>, algorithm: &DerElement): Result<bool, X509Error>

Parameters:

NameType
inputSpan<u8>
algorithm&DerElement

Returns: Result<bool, X509Error>


explicitElement ​

📄 x509.vx L113-127

vex
fn explicitElement(input: Span<u8>, wrapper: &DerElement): Result<DerElement, X509Error>

Parameters:

NameType
inputSpan<u8>
wrapper&DerElement

Returns: Result<DerElement, X509Error>


x509Digit ​

📄 x509.vx L379-385

vex
fn x509Digit(input: Span<u8>, offset: usize): Result<i32, X509Error>

Parameters:

NameType
inputSpan<u8>
offsetusize

Returns: Result<i32, X509Error>


x509TwoDigits ​

📄 x509.vx L387-395

vex
fn x509TwoDigits(input: Span<u8>, offset: usize): Result<i32, X509Error>

Parameters:

NameType
inputSpan<u8>
offsetusize

Returns: Result<i32, X509Error>


x509LeapYear ​

📄 x509.vx L397-399

vex
fn x509LeapYear(year: i32): bool

Parameters:

NameType
yeari32

Returns: bool


x509DaysInMonth ​

📄 x509.vx L401-405

vex
fn x509DaysInMonth(year: i32, month: i32): i32

Parameters:

NameType
yeari32
monthi32

Returns: i32


x509DaysFromCivil ​

📄 x509.vx L407-417

vex
fn x509DaysFromCivil(year: i32, month: i32, day: i32): i64

Parameters:

NameType
yeari32
monthi32
dayi32

Returns: i64


parseCertificateTime ​

📄 x509.vx L419-480

vex
fn parseCertificateTime(input: Span<u8>, element: &DerElement): Result<i64, X509Error>

Parameters:

NameType
inputSpan<u8>
element&DerElement

Returns: Result<i64, X509Error>


extensionSequence ​

📄 x509.vx L534-544

vex
fn extensionSequence(input: Span<u8>, certificate: &X509CertificateView): Result<DerElement, X509Error>

Parameters:

NameType
inputSpan<u8>
certificate&X509CertificateView

Returns: Result<DerElement, X509Error>


extensionAt ​

📄 x509.vx L546-589

vex
fn extensionAt(input: Span<u8>, sequence: &DerElement, index: usize): Result<X509ExtensionView, X509Error>

Parameters:

NameType
inputSpan<u8>
sequence&DerElement
indexusize

Returns: Result<X509ExtensionView, X509Error>


oidMatches ​

📄 x509.vx L591-598

vex
fn oidMatches<const N: usize>( input: Span<u8>, oid: &DerElement, expected: &[u8; N] ): Result<bool, X509Error>

Type Parameters:

  • const N: usize

Parameters:

NameType
inputSpan<u8>
oid&DerElement
expected&[u8; N]

Returns: Result<bool, X509Error>


boundedPathLength ​

📄 x509.vx L615-633

vex
fn boundedPathLength(input: Span<u8>, magnitude: &DerSlice): Result<usize, X509Error>

Parameters:

NameType
inputSpan<u8>
magnitude&DerSlice

Returns: Result<usize, X509Error>


sameOid ​

📄 x509.vx L635-645

vex
fn sameOid(input: Span<u8>, left: &DerElement, right: &DerElement): Result<bool, X509Error>

Parameters:

NameType
inputSpan<u8>
left&DerElement
right&DerElement

Returns: Result<bool, X509Error>


parseBasicConstraints ​

📄 x509.vx L647-698

vex
fn parseBasicConstraints(input: Span<u8>, extension: &X509ExtensionView): Result<(bool, bool, usize), X509Error>

Parameters:

NameType
inputSpan<u8>
extension&X509ExtensionView

Returns: Result<(bool, bool, usize), X509Error>


parseKeyUsage ​

📄 x509.vx L700-731

vex
fn parseKeyUsage(input: Span<u8>, extension: &X509ExtensionView): Result<(bool, bool), X509Error>

Parameters:

NameType
inputSpan<u8>
extension&X509ExtensionView

Returns: Result<(bool, bool), X509Error>


parseExtendedKeyUsage ​

📄 x509.vx L733-776

vex
fn parseExtendedKeyUsage(input: Span<u8>, extension: &X509ExtensionView): Result<bool, X509Error>

Parameters:

NameType
inputSpan<u8>
extension&X509ExtensionView

Returns: Result<bool, X509Error>


extensionPolicy ​

📄 x509.vx L778-892

vex
fn extensionPolicy(input: Span<u8>, certificate: &X509CertificateView): Result<X509ExtensionPolicy, X509Error>

Parameters:

NameType
inputSpan<u8>
certificate&X509CertificateView

Returns: Result<X509ExtensionPolicy, X509Error>


namesEqual ​

📄 x509.vx L894-907

vex
fn namesEqual(childInput: Span<u8>, childCertificate: &X509CertificateView, issuerInput: Span<u8>, issuerCertificate: &X509CertificateView): Result<bool, X509Error>

Parameters:

NameType
childInputSpan<u8>
childCertificate&X509CertificateView
issuerInputSpan<u8>
issuerCertificate&X509CertificateView

Returns: Result<bool, X509Error>


subjectNameIsEmpty ​

📄 x509.vx L909-920

vex
fn subjectNameIsEmpty(input: Span<u8>, certificate: &X509CertificateView): Result<bool, X509Error>

Parameters:

NameType
inputSpan<u8>
certificate&X509CertificateView

Returns: Result<bool, X509Error>


validateLeafPolicy ​

📄 x509.vx L922-950

vex
fn validateLeafPolicy(input: Span<u8>, certificate: &X509CertificateView, facts: &X509ExtensionPolicy, referenceDnsName: str, unixSeconds: i64): Result<bool, X509Error>

Parameters:

NameType
inputSpan<u8>
certificate&X509CertificateView
facts&X509ExtensionPolicy
referenceDnsNamestr
unixSecondsi64

Returns: Result<bool, X509Error>


validateAuthorityPolicy ​

📄 x509.vx L952-980

vex
fn validateAuthorityPolicy(input: Span<u8>, certificate: &X509CertificateView, facts: &X509ExtensionPolicy, caCertificatesBelow: usize, unixSeconds: i64): Result<bool, X509Error>

Parameters:

NameType
inputSpan<u8>
certificate&X509CertificateView
facts&X509ExtensionPolicy
caCertificatesBelowusize
unixSecondsi64

Returns: Result<bool, X509Error>


certificateIsSelfIssued ​

📄 x509.vx L982-994

vex
fn certificateIsSelfIssued(input: Span<u8>, certificate: &X509CertificateView): Result<bool, X509Error>

Parameters:

NameType
inputSpan<u8>
certificate&X509CertificateView

Returns: Result<bool, X509Error>


subjectAltNames ​

📄 x509.vx L1078-1119

vex
fn subjectAltNames(input: Span<u8>, certificate: &X509CertificateView): Result<DerElement, X509Error>

Parameters:

NameType
inputSpan<u8>
certificate&X509CertificateView

Returns: Result<DerElement, X509Error>


arraySpan ​

📄 alert.test.vx L7-9

vex
fn arraySpan<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


mutableArraySpan ​

📄 alert.test.vx L11-13

vex
fn mutableArraySpan<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


test_tls_alert_canonical_roundtrip 🔓 export ​

📄 alert.test.vx L15-49

vex
export fn test_tls_alert_canonical_roundtrip(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_alert_rejects_noncanonical_emission 🔓 export ​

📄 alert.test.vx L51-66

vex
export fn test_tls_alert_rejects_noncanonical_emission(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_alert_decode_is_exact_and_downgrade_safe 🔓 export ​

📄 alert.test.vx L68-97

vex
export fn test_tls_alert_decode_is_exact_and_downgrade_safe(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

arraySpan ​

📄 assembler.test.vx L6-8

vex
fn arraySpan<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


mutableArraySpan ​

📄 assembler.test.vx L10-12

vex
fn mutableArraySpan<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


spansEqual ​

📄 assembler.test.vx L14-22

vex
fn spansEqual(left: Span<u8>, right: Span<u8>): bool

Parameters:

NameType
leftSpan<u8>
rightSpan<u8>

Returns: bool


test_tls_handshake_assembler_direct_and_coalesced_zero_copy 🔓 export ​

📄 assembler.test.vx L24-54

vex
export fn test_tls_handshake_assembler_direct_and_coalesced_zero_copy(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_handshake_assembler_every_two_fragment_split 🔓 export ​

📄 assembler.test.vx L56-83

vex
export fn test_tls_handshake_assembler_every_two_fragment_split(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_handshake_assembler_one_byte_fragments 🔓 export ​

📄 assembler.test.vx L85-110

vex
export fn test_tls_handshake_assembler_one_byte_fragments(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_handshake_assembler_rejections_are_atomic 🔓 export ​

📄 assembler.test.vx L112-141

vex
export fn test_tls_handshake_assembler_rejections_are_atomic(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_handshake_assembler_output_identity_and_boundaries 🔓 export ​

📄 assembler.test.vx L143-187

vex
export fn test_tls_handshake_assembler_output_identity_and_boundaries(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_handshake_assembler_zero_body_and_invalid_inputs 🔓 export ​

📄 assembler.test.vx L189-207

vex
export fn test_tls_handshake_assembler_zero_body_and_invalid_inputs(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

arraySpan ​

📄 bench.test.vx L14-16

vex
fn arraySpan<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


u16ArraySpan ​

📄 bench.test.vx L18-20

vex
fn u16ArraySpan<const N: usize>(value: &[u16; N]): Span<u16>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u16; N]

Returns: Span<u16>


state ​

📄 bench.test.vx L22-27

vex
fn state(cipherId: u16, key: Span<u8>, iv: Span<u8>): TlsCipherState

Parameters:

NameType
cipherIdu16
keySpan<u8>
ivSpan<u8>

Returns: TlsCipherState


decrypt_record_seq_zero ​

📄 bench.test.vx L29-41

vex
fn decrypt_record_seq_zero(cipherId: u16, key: Span<u8>, iv: Span<u8>, record: Span<u8>, output: &Span<u8>!): usize

Parameters:

NameType
cipherIdu16
keySpan<u8>
ivSpan<u8>
recordSpan<u8>
output&Span<u8>!

Returns: usize


benchRecordDecrypt ​

📄 bench.test.vx L43-90

vex
fn benchRecordDecrypt<const KEY_LEN: usize>( b: &BenchCtx!, cipherId: u16, keyBytes: &[u8; KEY_LEN], size: usize )

Type Parameters:

  • const KEY_LEN: usize

Parameters:

NameType
b&BenchCtx!
cipherIdu16
keyBytes&[u8; KEY_LEN]
sizeusize

bench_tls_record_decrypt_chacha20_10kb ​

📄 bench.test.vx L92-95

vex
fn bench_tls_record_decrypt_chacha20_10kb(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_tls_record_decrypt_chacha20_16kb ​

📄 bench.test.vx L97-100

vex
fn bench_tls_record_decrypt_chacha20_16kb(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_tls_record_decrypt_aes128_gcm_16kb ​

📄 bench.test.vx L102-105

vex
fn bench_tls_record_decrypt_aes128_gcm_16kb(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_tls_derive_traffic_keys_sha256 ​

📄 bench.test.vx L107-122

vex
fn bench_tls_derive_traffic_keys_sha256(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_tls_derive_traffic_keys_sha384 ​

📄 bench.test.vx L124-139

vex
fn bench_tls_derive_traffic_keys_sha384(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

appendSelectedTranscript ​

📄 bench.test.vx L141-152

vex
fn appendSelectedTranscript(body: Span<u8>): usize

Parameters:

NameType
bodySpan<u8>

Returns: usize


appendDualTranscript ​

📄 bench.test.vx L154-163

vex
fn appendDualTranscript(body: Span<u8>): usize

Parameters:

NameType
bodySpan<u8>

Returns: usize


bench_tls_transcript_selected_sha256_1kb ​

📄 bench.test.vx L165-172

vex
fn bench_tls_transcript_selected_sha256_1kb(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_tls_transcript_dual_hash_1kb ​

📄 bench.test.vx L174-181

vex
fn bench_tls_transcript_dual_hash_1kb(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

deriveHandshakeScheduleSha256 ​

📄 bench.test.vx L183-199

vex
fn deriveHandshakeScheduleSha256(transcript: &TlsTranscript, sharedSecret: Span<u8>, clientOut: &Span<u8>!, serverOut: &Span<u8>!): usize

Parameters:

NameType
transcript&TlsTranscript
sharedSecretSpan<u8>
clientOut&Span<u8>!
serverOut&Span<u8>!

Returns: usize


bench_tls_handshake_schedule_sha256 ​

📄 bench.test.vx L201-222

vex
fn bench_tls_handshake_schedule_sha256(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_tls_finished_sha256 ​

📄 bench.test.vx L224-239

vex
fn bench_tls_finished_sha256(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

buildClientHelloBenchmark ​

📄 bench.test.vx L241-279

vex
fn buildClientHelloBenchmark(output: &Span<u8>!): usize

Parameters:

NameType
output&Span<u8>!

Returns: usize


decodeClientHelloBench ​

📄 bench.test.vx L281-286

vex
fn decodeClientHelloBench(encoded: Span<u8>): usize

Parameters:

NameType
encodedSpan<u8>

Returns: usize


bench_tls_client_hello_decode ​

📄 bench.test.vx L288-296

vex
fn bench_tls_client_hello_decode(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_tls_handshake_assembler_direct ​

📄 bench.test.vx L298-314

vex
fn bench_tls_handshake_assembler_direct(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_tls_handshake_assembler_fragmented_1kb ​

📄 bench.test.vx L316-339

vex
fn bench_tls_handshake_assembler_fragmented_1kb(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

arraySpan ​

📄 handshake.test.vx L7-9

vex
fn arraySpan<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


mutableArraySpan ​

📄 handshake.test.vx L11-13

vex
fn mutableArraySpan<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


test_tls_hkdf_expand_label_sha256_vector 🔓 export ​

📄 handshake.test.vx L15-37

vex
export fn test_tls_hkdf_expand_label_sha256_vector(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_hkdf_expand_label_sha384_vector 🔓 export ​

📄 handshake.test.vx L39-63

vex
export fn test_tls_hkdf_expand_label_sha384_vector(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_hkdf_expand_label_rejects_invalid_lengths_and_aliasing 🔓 export ​

📄 handshake.test.vx L65-96

vex
export fn test_tls_hkdf_expand_label_rejects_invalid_lengths_and_aliasing(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_traffic_key_schedule_validates_suite_and_outputs 🔓 export ​

📄 handshake.test.vx L98-152

vex
export fn test_tls_traffic_key_schedule_validates_suite_and_outputs(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

helloErrorName ​

📄 hello.test.vx L13-28

vex
fn helloErrorName(failure: TlsHelloError): str

Parameters:

NameType
failureTlsHelloError

Returns: str


arraySpan ​

📄 hello.test.vx L30-32

vex
fn arraySpan<T, const N: usize>(value: &[T; N]): Span<T>

Type Parameters:

  • T
  • const N: usize

Parameters:

NameType
value&[T; N]

Returns: Span<T>


mutableArraySpan ​

📄 hello.test.vx L34-36

vex
fn mutableArraySpan<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


appendClientExtensions ​

📄 hello.test.vx L38-69

vex
fn appendClientExtensions(storage: &[u8; 128]!, key: Span<u8>): Result<usize, TlsHelloError>

Parameters:

NameType
storage&[u8; 128]!
keySpan<u8>

Returns: Result<usize, TlsHelloError>


appendServerExtensions ​

📄 hello.test.vx L71-88

vex
fn appendServerExtensions(storage: &[u8; 96]!, key: Span<u8>): Result<usize, TlsHelloError>

Parameters:

NameType
storage&[u8; 96]!
keySpan<u8>

Returns: Result<usize, TlsHelloError>


test_tls_client_hello_codec_roundtrip_and_views 🔓 export ​

📄 hello.test.vx L90-150

vex
export fn test_tls_client_hello_codec_roundtrip_and_views(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_server_hello_codec_roundtrip 🔓 export ​

📄 hello.test.vx L152-183

vex
export fn test_tls_server_hello_codec_roundtrip(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_client_hello_duplicate_and_order_rejections 🔓 export ​

📄 hello.test.vx L185-227

vex
export fn test_tls_client_hello_duplicate_and_order_rejections(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_hello_lengths_and_aliasing_fail_before_mutation 🔓 export ​

📄 hello.test.vx L229-246

vex
export fn test_tls_hello_lengths_and_aliasing_fail_before_mutation(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_hello_retry_request_and_group_coherence 🔓 export ​

📄 hello.test.vx L248-305

vex
export fn test_tls_hello_retry_request_and_group_coherence(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

📄 hello.test.vx L307-387

vex
export fn test_tls_hello_cookie_and_padding_are_exact(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_client_hello_rejects_every_truncated_prefix 🔓 export ​

📄 hello.test.vx L389-422

vex
export fn test_tls_client_hello_rejects_every_truncated_prefix(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

bytes ​

📄 hostname.test.vx L6-8

vex
fn bytes(value: str): Span<u8>

Parameters:

NameType
valuestr

Returns: Span<u8>


matches ​

📄 hostname.test.vx L10-15

vex
fn matches(reference: str, presented: str): bool

Parameters:

NameType
referencestr
presentedstr

Returns: bool


test_tls_dns_identity_exact_ascii 🔓 export ​

📄 hostname.test.vx L17-23

vex
export fn test_tls_dns_identity_exact_ascii(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_dns_identity_wildcard_is_one_complete_label 🔓 export ​

📄 hostname.test.vx L25-40

vex
export fn test_tls_dns_identity_wildcard_is_one_complete_label(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_dns_identity_rejects_malformed_and_ip_refs 🔓 export ​

📄 hostname.test.vx L42-59

vex
export fn test_tls_dns_identity_rejects_malformed_and_ip_refs(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

arraySpan ​

📄 key_schedule.test.vx L10-12

vex
fn arraySpan<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


mutableArraySpan ​

📄 key_schedule.test.vx L14-16

vex
fn mutableArraySpan<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


assertPrefix ​

📄 key_schedule.test.vx L18-26

vex
fn assertPrefix<const N: usize>( ctx: &TestCtx!, actual: &[u8; N], expected: &[u8; N] )

Type Parameters:

  • const N: usize

Parameters:

NameType
ctx&TestCtx!
actual&[u8; N]
expected&[u8; N]

test_tls_rfc8448_handshake_traffic_secrets 🔓 export ​

📄 key_schedule.test.vx L31-76

vex
export fn test_tls_rfc8448_handshake_traffic_secrets(ctx: &TestCtx!)

RFC 8448 section 4 resumed-handshake trace: handshake secret and

ClientHello..ServerHello transcript hash derive the published traffic secrets. This locks the TLS label encoding and Derive-Secret boundary.

Parameters:

NameType
ctx&TestCtx!

test_tls_secret_schedule_orders_transitions_and_finished 🔓 export ​

📄 key_schedule.test.vx L78-213

vex
export fn test_tls_secret_schedule_orders_transitions_and_finished(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_sha384_schedule_and_finished_validation 🔓 export ​

📄 key_schedule.test.vx L215-304

vex
export fn test_tls_sha384_schedule_and_finished_validation(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_secret_schedule_retire_is_irreversible 🔓 export ​

📄 key_schedule.test.vx L306-334

vex
export fn test_tls_secret_schedule_retire_is_irreversible(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

arraySpan ​

📄 key_update.test.vx L10-12

vex
fn arraySpan<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


mutableArraySpan ​

📄 key_update.test.vx L14-16

vex
fn mutableArraySpan<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


strBytes ​

📄 key_update.test.vx L18-20

vex
fn strBytes(value: str): Span<u8>

Parameters:

NameType
valuestr

Returns: Span<u8>


traffic ​

📄 key_update.test.vx L22-29

vex
fn traffic(send: Span<u8>, receive: Span<u8>): TlsApplicationTraffic

Parameters:

NameType
sendSpan<u8>
receiveSpan<u8>

Returns: TlsApplicationTraffic


cipher ​

📄 key_update.test.vx L31-52

vex
fn cipher(secret: Span<u8>): TlsCipherState

Parameters:

NameType
secretSpan<u8>

Returns: TlsCipherState


test_tls_key_update_codec_and_independent_schedule_vector 🔓 export ​

📄 key_update.test.vx L54-101

vex
export fn test_tls_key_update_codec_and_independent_schedule_vector(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_key_update_switches_generation_after_old_key_record 🔓 export ​

📄 key_update.test.vx L103-143

vex
export fn test_tls_key_update_switches_generation_after_old_key_record(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_requested_key_update_orders_response_before_data 🔓 export ​

📄 key_update.test.vx L145-192

vex
export fn test_tls_requested_key_update_orders_response_before_data(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_key_update_capacity_failure_is_atomic 🔓 export ​

📄 key_update.test.vx L194-208

vex
export fn test_tls_key_update_capacity_failure_is_atomic(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_fragmented_key_update_commits_only_after_last_fragment 🔓 export ​

📄 key_update.test.vx L210-271

vex
export fn test_tls_fragmented_key_update_commits_only_after_last_fragment(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_new_generation_is_rejected_before_key_update_record 🔓 export ​

📄 key_update.test.vx L273-299

vex
export fn test_tls_new_generation_is_rejected_before_key_update_record(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_crossed_requested_key_updates_advance_two_generations 🔓 export ​

📄 key_update.test.vx L301-367

vex
export fn test_tls_crossed_requested_key_updates_advance_two_generations(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

arraySpan ​

📄 negotiation.test.vx L15-17

vex
fn arraySpan<T, const N: usize>(value: &[T; N]): Span<T>

Type Parameters:

  • T
  • const N: usize

Parameters:

NameType
value&[T; N]

Returns: Span<T>


mutableArraySpan ​

📄 negotiation.test.vx L19-21

vex
fn mutableArraySpan<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


samePrefix ​

📄 negotiation.test.vx L23-28

vex
fn samePrefix(left: Span<u8>, right: Span<u8>, length: usize): bool

Parameters:

NameType
leftSpan<u8>
rightSpan<u8>
lengthusize

Returns: bool


appendClientExtensions ​

📄 negotiation.test.vx L30-57

vex
fn appendClientExtensions(storage: &[u8; 128]!, key: Span<u8>): usize

Parameters:

NameType
storage&[u8; 128]!
keySpan<u8>

Returns: usize


appendClientExtensionsWithoutKeyShare ​

📄 negotiation.test.vx L59-78

vex
fn appendClientExtensionsWithoutKeyShare(storage: &[u8; 128]!): usize

Parameters:

NameType
storage&[u8; 128]!

Returns: usize


appendRetryClientExtensions ​

📄 negotiation.test.vx L80-99

vex
fn appendRetryClientExtensions(storage: &[u8; 128]!, key: Span<u8>, cookie: Span<u8>): usize

Parameters:

NameType
storage&[u8; 128]!
keySpan<u8>
cookieSpan<u8>

Returns: usize


buildClientHello ​

📄 negotiation.test.vx L101-116

vex
fn buildClientHello(key: Span<u8>, session: Span<u8>, ciphers: Span<u16>, storage: &[u8; 256]!): usize

Parameters:

NameType
keySpan<u8>
sessionSpan<u8>
ciphersSpan<u16>
storage&[u8; 256]!

Returns: usize


buildClientHelloWithoutKeyShare ​

📄 negotiation.test.vx L118-132

vex
fn buildClientHelloWithoutKeyShare(session: Span<u8>, ciphers: Span<u16>, storage: &[u8; 256]!): usize

Parameters:

NameType
sessionSpan<u8>
ciphersSpan<u16>
storage&[u8; 256]!

Returns: usize


buildRetryClientHello ​

📄 negotiation.test.vx L134-149

vex
fn buildRetryClientHello(key: Span<u8>, cookie: Span<u8>, session: Span<u8>, ciphers: Span<u16>, storage: &[u8; 256]!): usize

Parameters:

NameType
keySpan<u8>
cookieSpan<u8>
sessionSpan<u8>
ciphersSpan<u16>
storage&[u8; 256]!

Returns: usize


buildServerHello ​

📄 negotiation.test.vx L151-174

vex
fn buildServerHello(random: &[u8; 32], key: Span<u8>, session: Span<u8>, cipher: u16, storage: &[u8; 192]!): usize

Parameters:

NameType
random&[u8; 32]
keySpan<u8>
sessionSpan<u8>
cipheru16
storage&[u8; 192]!

Returns: usize


newOwner ​

📄 negotiation.test.vx L176-180

vex
fn newOwner(role: TlsHandshakeRole, privateKey: Span<u8>): Result<TlsX25519Negotiation, TlsX25519NegotiationError>

Parameters:

NameType
roleTlsHandshakeRole
privateKeySpan<u8>

Returns: Result<TlsX25519Negotiation, TlsX25519NegotiationError>


test_tls_x25519_negotiation_matches_both_roles_sha256 🔓 export ​

📄 negotiation.test.vx L182-254

vex
export fn test_tls_x25519_negotiation_matches_both_roles_sha256(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_x25519_negotiation_sha384_and_single_use 🔓 export ​

📄 negotiation.test.vx L256-298

vex
export fn test_tls_x25519_negotiation_sha384_and_single_use(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_x25519_negotiation_rejects_low_order_before_commit 🔓 export ​

📄 negotiation.test.vx L300-334

vex
export fn test_tls_x25519_negotiation_rejects_low_order_before_commit(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

📄 negotiation.test.vx L336-470

vex
export fn test_tls_x25519_negotiation_hrr_cookie_only_replay(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

📄 negotiation.test.vx L472-546

vex
export fn test_tls_x25519_negotiation_hrr_cookie_limit_is_transactional(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_x25519_negotiation_hrr_commits_fresh_client_hello 🔓 export ​

📄 negotiation.test.vx L548-736

vex
export fn test_tls_x25519_negotiation_hrr_commits_fresh_client_hello(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_x25519_negotiation_preconditions_fail_closed 🔓 export ​

📄 negotiation.test.vx L738-822

vex
export fn test_tls_x25519_negotiation_preconditions_fail_closed(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

bytes ​

📄 negotiation_bench.test.vx L12-14

vex
fn bytes<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


words ​

📄 negotiation_bench.test.vx L16-18

vex
fn words<const N: usize>(value: &[u16; N]): Span<u16>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u16; N]

Returns: Span<u16>


bytesMut ​

📄 negotiation_bench.test.vx L20-22

vex
fn bytesMut<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


buildClient ​

📄 negotiation_bench.test.vx L24-57

vex
fn buildClient(key: Span<u8>, output: &Span<u8>!): usize

Parameters:

NameType
keySpan<u8>
output&Span<u8>!

Returns: usize


buildServer ​

📄 negotiation_bench.test.vx L59-80

vex
fn buildServer(key: Span<u8>, output: &Span<u8>!): usize

Parameters:

NameType
keySpan<u8>
output&Span<u8>!

Returns: usize


appendClientCapabilities ​

📄 negotiation_bench.test.vx L82-122

vex
fn appendClientCapabilities(extensions: Span<u8>, key: Option<Span<u8>>, cookie: Option<Span<u8>>): usize

Parameters:

NameType
extensionsSpan<u8>
keyOption<Span<u8>>
cookieOption<Span<u8>>

Returns: usize


buildRetryClient ​

📄 negotiation_bench.test.vx L124-140

vex
fn buildRetryClient(key: Option<Span<u8>>, cookie: Option<Span<u8>>, output: &Span<u8>!): usize

Parameters:

NameType
keyOption<Span<u8>>
cookieOption<Span<u8>>
output&Span<u8>!

Returns: usize


buildHelloRetry ​

📄 negotiation_bench.test.vx L142-172

vex
fn buildHelloRetry(cookie: Span<u8>, output: &Span<u8>!): usize

Parameters:

NameType
cookieSpan<u8>
output&Span<u8>!

Returns: usize


negotiateClient ​

📄 negotiation_bench.test.vx L174-191

vex
fn negotiateClient(privateKey: Span<u8>, clientHello: Span<u8>, serverHello: Span<u8>, clientTraffic: &Span<u8>!, serverTraffic: &Span<u8>!): usize

Parameters:

NameType
privateKeySpan<u8>
clientHelloSpan<u8>
serverHelloSpan<u8>
clientTraffic&Span<u8>!
serverTraffic&Span<u8>!

Returns: usize


negotiateRetryClient ​

📄 negotiation_bench.test.vx L193-219

vex
fn negotiateRetryClient(initialPrivate: Span<u8>, retryPrivate: Span<u8>, clientHello1: Span<u8>, helloRetry: Span<u8>, clientHello2: Span<u8>, serverHello: Span<u8>, clientTraffic: &Span<u8>!, serverTraffic: &Span<u8>!): usize

Parameters:

NameType
initialPrivateSpan<u8>
retryPrivateSpan<u8>
clientHello1Span<u8>
helloRetrySpan<u8>
clientHello2Span<u8>
serverHelloSpan<u8>
clientTraffic&Span<u8>!
serverTraffic&Span<u8>!

Returns: usize


bench_tls_x25519_full_client_negotiation_sha256 ​

📄 negotiation_bench.test.vx L221-254

vex
fn bench_tls_x25519_full_client_negotiation_sha256(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_tls_x25519_hrr_client_negotiation_sha256 ​

📄 negotiation_bench.test.vx L256-311

vex
fn bench_tls_x25519_hrr_client_negotiation_sha256(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

arraySpan ​

📄 record.test.vx L9-11

vex
fn arraySpan<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


mutableArraySpan ​

📄 record.test.vx L13-15

vex
fn mutableArraySpan<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


strBytes ​

📄 record.test.vx L17-19

vex
fn strBytes(value: str): Span<u8>

Parameters:

NameType
valuestr

Returns: Span<u8>


aes128State ​

📄 record.test.vx L21-28

vex
fn aes128State(key: &[u8; 16], iv: &[u8; 12]): TlsCipherState

Parameters:

NameType
key&[u8; 16]
iv&[u8; 12]

Returns: TlsCipherState


cipherState ​

📄 record.test.vx L30-35

vex
fn cipherState(cipherId: u16, key: Span<u8>, iv: Span<u8>): TlsCipherState

Parameters:

NameType
cipherIdu16
keySpan<u8>
ivSpan<u8>

Returns: TlsCipherState


encryptFailedWith ​

📄 record.test.vx L37-42

vex
fn encryptFailedWith(result: Result<usize, TlsRecordError>, kind: TlsRecordError): bool

Parameters:

NameType
resultResult<usize, TlsRecordError>
kindTlsRecordError

Returns: bool


decryptFailedWith ​

📄 record.test.vx L44-49

vex
fn decryptFailedWith(result: Result<TlsPlaintext, TlsRecordError>, kind: TlsRecordError): bool

Parameters:

NameType
resultResult<TlsPlaintext, TlsRecordError>
kindTlsRecordError

Returns: bool


test_tls_record_header_encoding_and_bounds 🔓 export ​

📄 record.test.vx L51-75

vex
export fn test_tls_record_header_encoding_and_bounds(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_record_encrypt_decrypt_roundtrip 🔓 export ​

📄 record.test.vx L77-102

vex
export fn test_tls_record_encrypt_decrypt_roundtrip(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_record_rejects_truncated_and_malformed_headers 🔓 export ​

📄 record.test.vx L104-140

vex
export fn test_tls_record_rejects_truncated_and_malformed_headers(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_record_auth_failure_zeroes_plaintext_and_preserves_sequence 🔓 export ​

📄 record.test.vx L142-173

vex
export fn test_tls_record_auth_failure_zeroes_plaintext_and_preserves_sequence(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_record_rejects_invalid_key_buffer_and_oversize 🔓 export ​

📄 record.test.vx L175-207

vex
export fn test_tls_record_rejects_invalid_key_buffer_and_oversize(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_record_empty_plaintext_is_not_an_error 🔓 export ​

📄 record.test.vx L209-231

vex
export fn test_tls_record_empty_plaintext_is_not_an_error(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_record_rejects_overlapping_decrypt_output 🔓 export ​

📄 record.test.vx L233-253

vex
export fn test_tls_record_rejects_overlapping_decrypt_output(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_record_owns_key_material_and_supports_all_record_ciphers 🔓 export ​

📄 record.test.vx L255-310

vex
export fn test_tls_record_owns_key_material_and_supports_all_record_ciphers(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_record_rejects_encrypt_alias_and_short_decrypt_output 🔓 export ​

📄 record.test.vx L312-344

vex
export fn test_tls_record_rejects_encrypt_alias_and_short_decrypt_output(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

arraySpan ​

📄 transcript.test.vx L10-12

vex
fn arraySpan<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


mutableArraySpan ​

📄 transcript.test.vx L14-16

vex
fn mutableArraySpan<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


assertBytes ​

📄 transcript.test.vx L18-24

vex
fn assertBytes<const N: usize>(ctx: &TestCtx!, actual: &[u8; N], expected: &[u8; N])

Type Parameters:

  • const N: usize

Parameters:

NameType
ctx&TestCtx!
actual&[u8; N]
expected&[u8; N]

test_tls_handshake_header_codec_is_exact_and_bounded 🔓 export ​

📄 transcript.test.vx L26-63

vex
export fn test_tls_handshake_header_codec_is_exact_and_bounded(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transcript_sha256_streaming_snapshot 🔓 export ​

📄 transcript.test.vx L65-111

vex
export fn test_tls_transcript_sha256_streaming_snapshot(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transcript_sha384_matches_independent_vector 🔓 export ​

📄 transcript.test.vx L113-140

vex
export fn test_tls_transcript_sha384_matches_independent_vector(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transcript_rejections_are_atomic 🔓 export ​

📄 transcript.test.vx L142-188

vex
export fn test_tls_transcript_rejections_are_atomic(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transcript_hello_retry_rewrite_sha256 🔓 export ​

📄 transcript.test.vx L190-230

vex
export fn test_tls_transcript_hello_retry_rewrite_sha256(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transcript_hello_retry_rewrite_sha384 🔓 export ​

📄 transcript.test.vx L232-266

vex
export fn test_tls_transcript_hello_retry_rewrite_sha384(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transcript_constructor_and_output_fail_closed 🔓 export ​

📄 transcript.test.vx L268-292

vex
export fn test_tls_transcript_constructor_and_output_fail_closed(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transcript_tracks_both_hashes_until_selection 🔓 export ​

📄 transcript.test.vx L294-360

vex
export fn test_tls_transcript_tracks_both_hashes_until_selection(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

arraySpan ​

📄 transport.test.vx L10-12

vex
fn arraySpan<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


mutableArraySpan ​

📄 transport.test.vx L14-16

vex
fn mutableArraySpan<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


strBytes ​

📄 transport.test.vx L18-20

vex
fn strBytes(value: str): Span<u8>

Parameters:

NameType
valuestr

Returns: Span<u8>


traffic ​

📄 transport.test.vx L22-29

vex
fn traffic(send: Span<u8>, receive: Span<u8>): TlsApplicationTraffic

Parameters:

NameType
sendSpan<u8>
receiveSpan<u8>

Returns: TlsApplicationTraffic


peerCipher ​

📄 transport.test.vx L31-53

vex
fn peerCipher(secret: Span<u8>): TlsCipherState

Parameters:

NameType
secretSpan<u8>

Returns: TlsCipherState


test_tls_transport_application_roundtrip 🔓 export ​

📄 transport.test.vx L55-79

vex
export fn test_tls_transport_application_roundtrip(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transport_close_notify_is_half_close_then_closed 🔓 export ​

📄 transport.test.vx L81-132

vex
export fn test_tls_transport_close_notify_is_half_close_then_closed(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transport_capacity_failure_is_retryable 🔓 export ​

📄 transport.test.vx L134-153

vex
export fn test_tls_transport_capacity_failure_is_retryable(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transport_local_user_canceled_orders_shutdown 🔓 export ​

📄 transport.test.vx L155-196

vex
export fn test_tls_transport_local_user_canceled_orders_shutdown(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transport_fatal_alert_retires_both_peers 🔓 export ​

📄 transport.test.vx L198-221

vex
export fn test_tls_transport_fatal_alert_retires_both_peers(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transport_wire_failure_poisoning_is_contextual 🔓 export ​

📄 transport.test.vx L223-272

vex
export fn test_tls_transport_wire_failure_poisoning_is_contextual(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transport_user_canceled_requires_close_notify 🔓 export ​

📄 transport.test.vx L274-313

vex
export fn test_tls_transport_user_canceled_requires_close_notify(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_transport_authenticated_control_messages_fail_closed 🔓 export ​

📄 transport.test.vx L315-361

vex
export fn test_tls_transport_authenticated_control_messages_fail_closed(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

certSpan ​

📄 x509.test.vx L69-71

vex
fn certSpan(value: &[u8; 416]): Span<u8>

Parameters:

NameType
value&[u8; 416]

Returns: Span<u8>


stringBytes ​

📄 x509.test.vx L73-75

vex
fn stringBytes(value: &string): Span<u8>

Parameters:

NameType
value&string

Returns: Span<u8>


x509ArrayBytes ​

📄 x509.test.vx L77-79

vex
fn x509ArrayBytes<const N: usize>(value: &[u8; N]): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]

Returns: Span<u8>


x509MutableArrayBytes ​

📄 x509.test.vx L81-83

vex
fn x509MutableArrayBytes<const N: usize>(value: &[u8; N]!): Span<u8>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[u8; N]!

Returns: Span<u8>


x509WriteU16 ​

📄 x509.test.vx L85-88

vex
fn x509WriteU16(raw: RawBuf, offset: usize, value: usize)

Parameters:

NameType
rawRawBuf
offsetusize
valueusize

x509WriteU24 ​

📄 x509.test.vx L90-94

vex
fn x509WriteU24(raw: RawBuf, offset: usize, value: usize)

Parameters:

NameType
rawRawBuf
offsetusize
valueusize

buildAuthenticatedClientHelloWithAlpn ​

📄 x509.test.vx L96-136

vex
fn buildAuthenticatedClientHelloWithAlpn(key: Span<u8>, alpnData: Span<u8>, output: &[u8; 256]!): usize

Parameters:

NameType
keySpan<u8>
alpnDataSpan<u8>
output&[u8; 256]!

Returns: usize


buildAuthenticatedClientHello ​

📄 x509.test.vx L138-144

vex
fn buildAuthenticatedClientHello(key: Span<u8>, output: &[u8; 256]!): usize

Parameters:

NameType
keySpan<u8>
output&[u8; 256]!

Returns: usize


buildAuthenticatedServerHello ​

📄 x509.test.vx L146-166

vex
fn buildAuthenticatedServerHello(key: Span<u8>, output: &[u8; 192]!): usize

Parameters:

NameType
keySpan<u8>
output&[u8; 192]!

Returns: usize


buildServerCertificateChainMessage ​

📄 x509.test.vx L168-197

vex
fn buildServerCertificateChainMessage(leaf: Span<u8>, intermediate: Span<u8>, output: &[u8; 1024]!): usize

Parameters:

NameType
leafSpan<u8>
intermediateSpan<u8>
output&[u8; 1024]!

Returns: usize


buildAuthenticatedCertificateVerify ​

📄 x509.test.vx L199-239

vex
fn buildAuthenticatedCertificateVerify(transcript: &TlsTranscript, output: &[u8; 72]!): usize

Parameters:

NameType
transcript&TlsTranscript
output&[u8; 72]!

Returns: usize


buildAuthenticatedFinished ​

📄 x509.test.vx L241-256

vex
fn buildAuthenticatedFinished(transcript: &TlsTranscript, baseKey: Span<u8>, output: &[u8; 52]!): usize

Parameters:

NameType
transcript&TlsTranscript
baseKeySpan<u8>
output&[u8; 52]!

Returns: usize


buildServerCertificateMessage ​

📄 x509.test.vx L258-275

vex
fn buildServerCertificateMessage(leaf: Span<u8>, output: &[u8; 448]!)

Parameters:

NameType
leafSpan<u8>
output&[u8; 448]!

certificateInputs ​

📄 x509.test.vx L277-279

vex
fn certificateInputs<const N: usize>(value: &[Span<u8>; N]): Span<Span<u8>>

Type Parameters:

  • const N: usize

Parameters:

NameType
value&[Span<u8>; N]

Returns: Span<Span<u8>>


test_x509_ed25519_view_signature_and_san 🔓 export ​

📄 x509.test.vx L281-305

vex
export fn test_x509_ed25519_view_signature_and_san(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_x509_rejects_tamper_and_unsupported_algorithm 🔓 export ​

📄 x509.test.vx L307-332

vex
export fn test_x509_rejects_tamper_and_unsupported_algorithm(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_x509_requires_exact_der 🔓 export ​

📄 x509.test.vx L334-350

vex
export fn test_x509_requires_exact_der(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_x509_direct_tls_server_policy 🔓 export ​

📄 x509.test.vx L352-373

vex
export fn test_x509_direct_tls_server_policy(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_x509_direct_policy_time_signature_and_critical_extension 🔓 export ​

📄 x509.test.vx L375-439

vex
export fn test_x509_direct_policy_time_signature_and_critical_extension(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_x509_bounded_intermediate_chain_and_path_length 🔓 export ​

📄 x509.test.vx L441-532

vex
export fn test_x509_bounded_intermediate_chain_and_path_length(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_server_certificate_view_and_exact_framing 🔓 export ​

📄 x509.test.vx L534-572

vex
export fn test_tls_server_certificate_view_and_exact_framing(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_ed25519_server_certificate_verify_context 🔓 export ​

📄 x509.test.vx L574-627

vex
export fn test_tls_ed25519_server_certificate_verify_context(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_certificate_verify_exact_lengths 🔓 export ​

📄 x509.test.vx L629-645

vex
export fn test_tls_certificate_verify_exact_lengths(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_authentication_wire_builders 🔓 export ​

📄 x509.test.vx L647-694

vex
export fn test_tls_authentication_wire_builders(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

test_tls_authenticated_owner_full_flight 🔓 export ​

📄 x509.test.vx L696-865

vex
export fn test_tls_authenticated_owner_full_flight(ctx: &TestCtx!)

Parameters:

NameType
ctx&TestCtx!

runAuthenticatedClientFlight ​

📄 x509.test.vx L867-922

vex
fn runAuthenticatedClientFlight(clientPrivate: Span<u8>, clientHello: Span<u8>, serverHello: Span<u8>, encryptedExtensions: Span<u8>, certificate: Span<u8>, trustAnchor: Span<u8>, certificateVerify: Span<u8>, serverFinished: Span<u8>): usize

Parameters:

NameType
clientPrivateSpan<u8>
clientHelloSpan<u8>
serverHelloSpan<u8>
encryptedExtensionsSpan<u8>
certificateSpan<u8>
trustAnchorSpan<u8>
certificateVerifySpan<u8>
serverFinishedSpan<u8>

Returns: usize


bench_tls_authenticated_client_full_flight ​

📄 x509.test.vx L924-1028

vex
fn bench_tls_authenticated_client_full_flight(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_x509_ed25519_leaf_parse ​

📄 x509.test.vx L1031-1042

vex
fn bench_x509_ed25519_leaf_parse(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_x509_ed25519_direct_tls_policy ​

📄 x509.test.vx L1044-1058

vex
fn bench_x509_ed25519_direct_tls_policy(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_x509_ed25519_one_intermediate_policy ​

📄 x509.test.vx L1060-1079

vex
fn bench_x509_ed25519_one_intermediate_policy(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

bench_tls_ed25519_server_certificate_verify ​

📄 x509.test.vx L1081-1113

vex
fn bench_tls_ed25519_server_certificate_verify(b: &BenchCtx!)

Parameters:

NameType
b&BenchCtx!

Methods ​

isKind 🔓 export ​

📄 alert.vx L56-58

vex
export fn (self: &TlsAlertError) isKind(kind: TlsAlertError): bool

Receiver: self: &TlsAlertError (immutable reference)

Parameters:

NameType
kindTlsAlertError

Returns: bool


TlsAlert.closeNotify 🔓 export ​

📄 alert.vx L149-154

vex
export fn TlsAlert.closeNotify(): TlsAlert

Returns: TlsAlert


TlsAlert.userCanceled 🔓 export ​

📄 alert.vx L156-161

vex
export fn TlsAlert.userCanceled(): TlsAlert

Returns: TlsAlert


TlsAlert.fatal 🔓 export ​

📄 alert.vx L163-173

vex
export fn TlsAlert.fatal(description: TlsAlertDescription): Result<TlsAlert, TlsAlertError>

Parameters:

NameType
descriptionTlsAlertDescription

Returns: Result<TlsAlert, TlsAlertError>


isCloseNotify 🔓 export ​

📄 alert.vx L175-177

vex
export fn (self: &TlsAlert) isCloseNotify(): bool

Receiver: self: &TlsAlert (immutable reference)

Returns: bool


isUserCanceled 🔓 export ​

📄 alert.vx L179-181

vex
export fn (self: &TlsAlert) isUserCanceled(): bool

Receiver: self: &TlsAlert (immutable reference)

Returns: bool


isFatal 🔓 export ​

📄 alert.vx L186-189

vex
export fn (self: &TlsAlert) isFatal(): bool

Effective TLS 1.3 severity. A peer that incorrectly labels an error alert

as warning cannot downgrade it; only close_notify and user_canceled remain non-fatal.

Receiver: self: &TlsAlert (immutable reference)

Returns: bool


isKind 🔓 export ​

📄 assembler.vx L23-27

vex
export fn (self: &TlsHandshakeAssemblerError) isKind(kind: TlsHandshakeAssemblerError): bool

Receiver: self: &TlsHandshakeAssemblerError (immutable reference)

Parameters:

NameType
kindTlsHandshakeAssemblerError

Returns: bool


isComplete 🔓 export ​

📄 assembler.vx L48-54

vex
export fn (self: &TlsHandshakeFeedResult) isComplete(): bool

Receiver: self: &TlsHandshakeFeedResult (immutable reference)

Returns: bool


isDirect 🔓 export ​

📄 assembler.vx L56-58

vex
export fn (self: &TlsHandshakeFeedResult) isDirect(): bool

Receiver: self: &TlsHandshakeFeedResult (immutable reference)

Returns: bool


TlsHandshakeAssembler.new 🔓 export ​

📄 assembler.vx L129-146

vex
export fn TlsHandshakeAssembler.new(maxBodyLen: usize): Result<TlsHandshakeAssembler, TlsHandshakeAssemblerError>

Parameters:

NameType
maxBodyLenusize

Returns: Result<TlsHandshakeAssembler, TlsHandshakeAssemblerError>


TlsHandshakeAssembler.withProtocolLimit 🔓 export ​

📄 assembler.vx L148-153

vex
export fn TlsHandshakeAssembler.withProtocolLimit(): TlsHandshakeAssembler

Returns: TlsHandshakeAssembler


isIdle 🔓 export ​

📄 assembler.vx L155-157

vex
export fn (self: &TlsHandshakeAssembler) isIdle(): bool

Receiver: self: &TlsHandshakeAssembler (immutable reference)

Returns: bool


maxMessageBodyLen 🔓 export ​

📄 assembler.vx L159-161

vex
export fn (self: &TlsHandshakeAssembler) maxMessageBodyLen(): usize

Receiver: self: &TlsHandshakeAssembler (immutable reference)

Returns: usize


pendingLen 🔓 export ​

📄 assembler.vx L166-169

vex
export fn (self: &TlsHandshakeAssembler) pendingLen(): usize

Returns bytes already retained for the fragmented message. A partial

header reports its retained byte count; a known message reports the full encoded prefix written to the caller buffer.

Receiver: self: &TlsHandshakeAssembler (immutable reference)

Returns: usize


clearPending ​

📄 assembler.vx L171-180

vex
fn (self: &TlsHandshakeAssembler!) clearPending()

Receiver: self: &TlsHandshakeAssembler! (mutable reference)


abort 🔓 export ​

📄 assembler.vx L184-186

vex
export fn (self: &TlsHandshakeAssembler!) abort()

Explicitly abandons a partial message after the connection has entered a

fatal state. Normal parse errors do not call this automatically.

Receiver: self: &TlsHandshakeAssembler! (mutable reference)


requireNonHandshakeBoundary 🔓 export ​

📄 assembler.vx L190-196

vex
export fn (self: &TlsHandshakeAssembler) requireNonHandshakeBoundary(): Result<bool, TlsHandshakeAssemblerError>

RFC 8446 forbids interleaving another record content type through a

fragmented Handshake message.

Receiver: self: &TlsHandshakeAssembler (immutable reference)

Returns: Result<bool, TlsHandshakeAssemblerError>


requireKeyChangeBoundary 🔓 export ​

📄 assembler.vx L199-205

vex
export fn (self: &TlsHandshakeAssembler) requireKeyChangeBoundary(): Result<bool, TlsHandshakeAssemblerError>

Handshake messages may not cross a record-protection key change.

Receiver: self: &TlsHandshakeAssembler (immutable reference)

Returns: Result<bool, TlsHandshakeAssemblerError>


validateHeader ​

📄 assembler.vx L207-214

vex
fn (self: &TlsHandshakeAssembler) validateHeader(header: TlsHandshakeHeader): Result<usize, TlsHandshakeAssemblerError>

Receiver: self: &TlsHandshakeAssembler (immutable reference)

Parameters:

NameType
headerTlsHandshakeHeader

Returns: Result<usize, TlsHandshakeAssemblerError>


feed 🔓 export ​

📄 assembler.vx L248-412

vex
export fn (self: &TlsHandshakeAssembler!) feed(fragment: Span<u8>, output: &Span<u8>!): Result<TlsHandshakeFeedResult, TlsHandshakeAssemblerError>

Consumes at most one complete Handshake message from fragment.

Callers loop over fragment.skip(result.consumed) to handle coalesced messages. For CompleteDirect, consume fragment.take(result.encodedLen). For CompleteBuffered, consume output.take(result.encodedLen) before the next feed. The same output base address is required across a fragmented message, but its reported capacity may grow.

Receiver: self: &TlsHandshakeAssembler! (mutable reference)

Parameters:

NameType
fragmentSpan<u8>
output&Span<u8>!

Returns: Result<TlsHandshakeFeedResult, TlsHandshakeAssemblerError>


isKind 🔓 export ​

📄 certificate.vx L32-34

vex
export fn (self: &TlsCertificateError) isKind(kind: TlsCertificateError): bool

Receiver: self: &TlsCertificateError (immutable reference)

Parameters:

NameType
kindTlsCertificateError

Returns: bool


entryAt 🔓 export ​

📄 certificate.vx L143-150

vex
export fn (self: &TlsCertificateMessageView) entryAt(encoded: Span<u8>, index: usize): Result<TlsCertificateEntryView, TlsCertificateError>

Receiver: self: &TlsCertificateMessageView (immutable reference)

Parameters:

NameType
encodedSpan<u8>
indexusize

Returns: Result<TlsCertificateEntryView, TlsCertificateError>


digestLen 🔓 export ​

📄 handshake.vx L41-46

vex
export fn (self: &TlsHashAlgorithm) digestLen(): usize

Receiver: self: &TlsHashAlgorithm (immutable reference)

Returns: usize


maxExpandLen ​

📄 handshake.vx L48-50

vex
fn (self: &TlsHashAlgorithm) maxExpandLen(): usize

Receiver: self: &TlsHashAlgorithm (immutable reference)

Returns: usize


isKind 🔓 export ​

📄 handshake.vx L52-54

vex
export fn (self: &TlsKeyScheduleError) isKind(kind: TlsKeyScheduleError): bool

Receiver: self: &TlsKeyScheduleError (immutable reference)

Parameters:

NameType
kindTlsKeyScheduleError

Returns: bool


isKind 🔓 export ​

📄 hello.vx L56-58

vex
export fn (self: &TlsHelloError) isKind(kind: TlsHelloError): bool

Receiver: self: &TlsHelloError (immutable reference)

Parameters:

NameType
kindTlsHelloError

Returns: bool


resolve 🔓 export ​

📄 hello.vx L78-88

vex
export fn (self: &TlsWireSlice) resolve(encoded: Span<u8>): Result<Span<u8>, TlsHelloError>

Receiver: self: &TlsWireSlice (immutable reference)

Parameters:

NameType
encodedSpan<u8>

Returns: Result<Span<u8>, TlsHelloError>


entryAt 🔓 export ​

📄 hello.vx L135-174

vex
export fn (self: &TlsHelloExtensions) entryAt(encoded: Span<u8>, index: usize): Result<TlsExtensionEntry, TlsHelloError>

Resolves an extension by stable wire order. Unknown extension identities

remain available without weakening the typed views for core TLS 1.3 fields.

Receiver: self: &TlsHelloExtensions (immutable reference)

Parameters:

NameType
encodedSpan<u8>
indexusize

Returns: Result<TlsExtensionEntry, TlsHelloError>


find 🔓 export ​

📄 hello.vx L176-191

vex
export fn (self: &TlsHelloExtensions) find(encoded: Span<u8>, extensionType: u16): Result<Option<TlsWireSlice>, TlsHelloError>

Receiver: self: &TlsHelloExtensions (immutable reference)

Parameters:

NameType
encodedSpan<u8>
extensionTypeu16

Returns: Result<Option<TlsWireSlice>, TlsHelloError>


cipherSuiteAt 🔓 export ​

📄 hello.vx L203-218

vex
export fn (self: &TlsClientHelloView) cipherSuiteAt(encoded: Span<u8>, index: usize): Result<u16, TlsHelloError>

Receiver: self: &TlsClientHelloView (immutable reference)

Parameters:

NameType
encodedSpan<u8>
indexusize

Returns: Result<u16, TlsHelloError>


signatureSchemeCount 🔓 export ​

📄 hello.vx L223-230

vex
export fn (self: &TlsClientHelloView) signatureSchemeCount(): usize

Returns the number of structurally validated signature schemes advertised

by this ClientHello. The no-PSK decoder requires this extension, so a successfully decoded view always reports at least one entry.

Receiver: self: &TlsClientHelloView (immutable reference)

Returns: usize


signatureSchemeAt 🔓 export ​

📄 hello.vx L234-249

vex
export fn (self: &TlsClientHelloView) signatureSchemeAt(encoded: Span<u8>, index: usize): Result<u16, TlsHelloError>

Resolves one advertised signature scheme by wire order. Bounds and backing

are revalidated so a view cannot be paired with unrelated storage.

Receiver: self: &TlsClientHelloView (immutable reference)

Parameters:

NameType
encodedSpan<u8>
indexusize

Returns: Result<u16, TlsHelloError>


supportsGroup 🔓 export ​

📄 hello.vx L254-267

vex
export fn (self: &TlsClientHelloView) supportsGroup(encoded: Span<u8>, group: u16): Result<bool, TlsHelloError>

Reports whether the structurally validated supported_groups vector

contains group. The result is resolved against the exact encoded Hello, so a detached view cannot be paired with unrelated storage.

Receiver: self: &TlsClientHelloView (immutable reference)

Parameters:

NameType
encodedSpan<u8>
groupu16

Returns: Result<bool, TlsHelloError>


keyShareAt 🔓 export ​

📄 hello.vx L270-305

vex
export fn (self: &TlsClientHelloView) keyShareAt(encoded: Span<u8>, index: usize): Result<TlsKeyShareEntry, TlsHelloError>

Resolves one validated ClientHello KeyShareEntry by wire order.

Receiver: self: &TlsClientHelloView (immutable reference)

Parameters:

NameType
encodedSpan<u8>
indexusize

Returns: Result<TlsKeyShareEntry, TlsHelloError>


findKeyShare 🔓 export ​

📄 hello.vx L307-337

vex
export fn (self: &TlsClientHelloView) findKeyShare(encoded: Span<u8>, group: u16): Result<Option<TlsWireSlice>, TlsHelloError>

Receiver: self: &TlsClientHelloView (immutable reference)

Parameters:

NameType
encodedSpan<u8>
groupu16

Returns: Result<Option<TlsWireSlice>, TlsHelloError>


selectedKeyShare 🔓 export ​

📄 hello.vx L351-382

vex
export fn (self: &TlsServerHelloView) selectedKeyShare(encoded: Span<u8>): Result<TlsKeyShareEntry, TlsHelloError>

Resolves the sole normal ServerHello KeyShareEntry. HelloRetryRequest has

only a selected group and therefore returns a non-present key payload.

Receiver: self: &TlsServerHelloView (immutable reference)

Parameters:

NameType
encodedSpan<u8>

Returns: Result<TlsKeyShareEntry, TlsHelloError>


isKind 🔓 export ​

📄 hostname.vx L16-20

vex
export fn (self: &TlsDnsIdentityError) isKind(kind: TlsDnsIdentityErrorKind): bool

Receiver: self: &TlsDnsIdentityError (immutable reference)

Parameters:

NameType
kindTlsDnsIdentityErrorKind

Returns: bool


TlsDnsIdentity.matches 🔓 export ​

📄 hostname.vx L143-189

vex
export fn TlsDnsIdentity.matches(reference: str, presentedDnsId: Span<u8>): Result<bool, TlsDnsIdentityError>

Matches a caller reference hostname against the raw bytes of one dNSName

SAN entry. A wildcard is accepted only as the complete left-most label and consumes exactly one non-empty reference label. Both forms may contain one trailing root dot, which is ignored for comparison.

Parameters:

NameType
referencestr
presentedDnsIdSpan<u8>

Returns: Result<bool, TlsDnsIdentityError>


TlsSecretSchedule.new 🔓 export ​

📄 key_schedule.vx L139-163

vex
export fn TlsSecretSchedule.new(hash: TlsHashAlgorithm, psk: Span<u8>): Result<TlsSecretSchedule, TlsKeyScheduleError>

Starts the schedule at Early Secret. An empty PSK means the RFC 8446

no-PSK value: one digest-length block of zero octets.

Parameters:

NameType
hashTlsHashAlgorithm
pskSpan<u8>

Returns: Result<TlsSecretSchedule, TlsKeyScheduleError>


stage 🔓 export ​

📄 key_schedule.vx L165-165

vex
export fn (self: &TlsSecretSchedule) stage(): TlsSecretStage

Receiver: self: &TlsSecretSchedule (immutable reference)

Returns: TlsSecretStage


hashAlgorithm 🔓 export ​

📄 key_schedule.vx L167-169

vex
export fn (self: &TlsSecretSchedule) hashAlgorithm(): TlsHashAlgorithm

Receiver: self: &TlsSecretSchedule (immutable reference)

Returns: TlsHashAlgorithm


drop 🔓 export ​

📄 key_schedule.vx L171-174

vex
export fn (self: &TlsSecretSchedule!) drop()

Receiver: self: &TlsSecretSchedule! (mutable reference)


retire 🔓 export ​

📄 key_schedule.vx L178-181

vex
export fn (self: &TlsSecretSchedule!) retire()

Irreversibly erases a candidate schedule that negotiation did not select.

All subsequent transitions fail with InvalidState.

Receiver: self: &TlsSecretSchedule! (mutable reference)


deriveHandshakeTraffic 🔓 export ​

📄 key_schedule.vx L186-290

vex
export fn (self: &TlsSecretSchedule!) deriveHandshakeTraffic(sharedSecret: Span<u8>, transcript: &TlsTranscript, clientOut: &Span<u8>!, serverOut: &Span<u8>!): Result<usize, TlsKeyScheduleError>

Commits Early -> Handshake and writes client/server handshake traffic

secrets for the transcript through ServerHello. Empty sharedSecret selects the TLS PSK-only zero input.

Receiver: self: &TlsSecretSchedule! (mutable reference)

Parameters:

NameType
sharedSecretSpan<u8>
transcript&TlsTranscript
clientOut&Span<u8>!
serverOut&Span<u8>!

Returns: Result<usize, TlsKeyScheduleError>


deriveApplicationTraffic 🔓 export ​

📄 key_schedule.vx L294-390

vex
export fn (self: &TlsSecretSchedule!) deriveApplicationTraffic(transcript: &TlsTranscript, clientOut: &Span<u8>!, serverOut: &Span<u8>!): Result<usize, TlsKeyScheduleError>

Commits Handshake -> Master and writes generation-0 application traffic

secrets for the transcript through the server Finished message.

Receiver: self: &TlsSecretSchedule! (mutable reference)

Parameters:

NameType
transcript&TlsTranscript
clientOut&Span<u8>!
serverOut&Span<u8>!

Returns: Result<usize, TlsKeyScheduleError>


isKind 🔓 export ​

📄 key_update.vx L21-23

vex
export fn (self: &TlsKeyUpdateError) isKind(kind: TlsKeyUpdateError): bool

Receiver: self: &TlsKeyUpdateError (immutable reference)

Parameters:

NameType
kindTlsKeyUpdateError

Returns: bool


isKind 🔓 export ​

📄 negotiation.vx L89-93

vex
export fn (self: &TlsX25519NegotiationError) isKind(kind: TlsX25519NegotiationError): bool

Receiver: self: &TlsX25519NegotiationError (immutable reference)

Parameters:

NameType
kindTlsX25519NegotiationError

Returns: bool


TlsX25519Negotiation.new 🔓 export ​

📄 negotiation.vx L199-276

vex
export fn TlsX25519Negotiation.new(role: TlsHandshakeRole, privateKey: Span<u8>, transcriptLimit: usize): Result<TlsX25519Negotiation, TlsX25519NegotiationError>

Creates a role-bound no-PSK negotiation owner, copies the exact 32-byte

scalar, derives its public key without allocation and starts a dual-hash transcript with the requested hard byte limit.

Parameters:

NameType
roleTlsHandshakeRole
privateKeySpan<u8>
transcriptLimitusize

Returns: Result<TlsX25519Negotiation, TlsX25519NegotiationError>


TlsX25519Negotiation.withDefaultLimit 🔓 export ​

📄 negotiation.vx L279-283

vex
export fn TlsX25519Negotiation.withDefaultLimit(role: TlsHandshakeRole, privateKey: Span<u8>): Result<TlsX25519Negotiation, TlsX25519NegotiationError>

Creates a negotiation owner with TLS_DEFAULT_TRANSCRIPT_LIMIT.

Parameters:

NameType
roleTlsHandshakeRole
privateKeySpan<u8>

Returns: Result<TlsX25519Negotiation, TlsX25519NegotiationError>


role 🔓 export ​

📄 negotiation.vx L286-288

vex
export fn (self: &TlsX25519Negotiation) role(): TlsHandshakeRole

Returns the immutable endpoint role.

Receiver: self: &TlsX25519Negotiation (immutable reference)

Returns: TlsHandshakeRole


stage 🔓 export ​

📄 negotiation.vx L291-293

vex
export fn (self: &TlsX25519Negotiation) stage(): TlsX25519NegotiationStage

Returns the monotonic negotiation stage.

Receiver: self: &TlsX25519Negotiation (immutable reference)

Returns: TlsX25519NegotiationStage


transcript 🔓 export ​

📄 negotiation.vx L296-298

vex
export fn (self: &TlsX25519Negotiation) transcript(): &TlsTranscript

Borrows the transcript for read-only accounting or digest snapshots.

Receiver: self: &TlsX25519Negotiation (immutable reference)

Returns: &TlsTranscript


selectedCipher 🔓 export ​

📄 negotiation.vx L301-304

vex
export fn (self: &TlsX25519Negotiation) selectedCipher(): Option<u16>

Returns the selected suite after successful normal ServerHello processing.

Receiver: self: &TlsX25519Negotiation (immutable reference)

Returns: Option<u16>


selectedHash 🔓 export ​

📄 negotiation.vx L307-310

vex
export fn (self: &TlsX25519Negotiation) selectedHash(): Option<TlsHashAlgorithm>

Returns the suite-authoritative hash after successful negotiation.

Receiver: self: &TlsX25519Negotiation (immutable reference)

Returns: Option<TlsHashAlgorithm>


publicKeyTo 🔓 export ​

📄 negotiation.vx L313-326

vex
export fn (self: &TlsX25519Negotiation) publicKeyTo(output: &Span<u8>!): Result<usize, TlsX25519NegotiationError>

Copies the non-secret local public key into an exact 32-byte destination.

Receiver: self: &TlsX25519Negotiation (immutable reference)

Parameters:

NameType
output&Span<u8>!

Returns: Result<usize, TlsX25519NegotiationError>


commitClientHello 🔓 export ​

📄 negotiation.vx L448-618

vex
export fn (self: &TlsX25519Negotiation!) commitClientHello(encoded: Span<u8>): Result<usize, TlsX25519NegotiationError>

Validates and commits the exact ClientHello that entered the transcript.

Client role requires its encoded X25519 share to equal this owner's public key; server role captures the contributory peer candidate for ServerHello.

Receiver: self: &TlsX25519Negotiation! (mutable reference)

Parameters:

NameType
encodedSpan<u8>

Returns: Result<usize, TlsX25519NegotiationError>


commitRetryClientHello 🔓 export ​

📄 negotiation.vx L628-800

vex
export fn (self: &TlsX25519Negotiation!) commitRetryClientHello(encoded: Span<u8>, retryPrivateKey: Span<u8>): Result<usize, TlsX25519NegotiationError>

Validates and commits ClientHello2 after one authenticated

HelloRetryRequest transition. The caller supplies a fresh 32-byte private scalar only when HRR selected X25519. Client role derives the corresponding public share and commits the new scalar only after every wire, cookie, invariant and transcript check succeeds. Server role passes an empty span and captures the validated peer share. Cookie-only retries reuse the original key share byte-for-byte.

Receiver: self: &TlsX25519Negotiation! (mutable reference)

Parameters:

NameType
encodedSpan<u8>
retryPrivateKeySpan<u8>

Returns: Result<usize, TlsX25519NegotiationError>


cipherWasOffered ​

📄 negotiation.vx L802-807

vex
fn (self: &TlsX25519Negotiation) cipherWasOffered(cipherSuite: u16): bool

Receiver: self: &TlsX25519Negotiation (immutable reference)

Parameters:

NameType
cipherSuiteu16

Returns: bool


acceptServerHello 🔓 export ​

📄 negotiation.vx L829-1103

vex
export fn (self: &TlsX25519Negotiation!) acceptServerHello(encoded: Span<u8>, clientTrafficOut: &Span<u8>!, serverTrafficOut: &Span<u8>!): Result<usize, TlsX25519NegotiationError>

Validates normal ServerHello, computes the contributory X25519 secret, and

commits transcript/hash/schedule selection exactly once. A valid HelloRetryRequest commits the selected transcript rewrite and locks HelloRetryRequested; it is never mistaken for a traffic-secret-bearing ServerHello and never touches caller traffic outputs.

Receiver: self: &TlsX25519Negotiation! (mutable reference)

Parameters:

NameType
encodedSpan<u8>
clientTrafficOut&Span<u8>!
serverTrafficOut&Span<u8>!

Returns: Result<usize, TlsX25519NegotiationError>


extensionWasOffered ​

📄 negotiation.vx L1110-1117

vex
fn (self: &TlsX25519Negotiation) extensionWasOffered(identity: u16): bool

Receiver: self: &TlsX25519Negotiation (immutable reference)

Parameters:

NameType
identityu16

Returns: bool


alpnWasOffered ​

📄 negotiation.vx L1119-1143

vex
fn (self: &TlsX25519Negotiation) alpnWasOffered(selected: Span<u8>): bool

Receiver: self: &TlsX25519Negotiation (immutable reference)

Parameters:

NameType
selectedSpan<u8>

Returns: bool


validateEncryptedExtensions ​

📄 negotiation.vx L1150-1247

vex
fn (self: &TlsX25519Negotiation) validateEncryptedExtensions(encoded: Span<u8>): Result<TlsEncryptedExtensionsCandidate, TlsX25519NegotiationError>

Receiver: self: &TlsX25519Negotiation (immutable reference)

Parameters:

NameType
encodedSpan<u8>

Returns: Result<TlsEncryptedExtensionsCandidate, TlsX25519NegotiationError>


acceptEncryptedExtensions 🔓 export ​

📄 negotiation.vx L1253-1288

vex
export fn (self: &TlsX25519Negotiation!) acceptEncryptedExtensions(encoded: Span<u8>): Result<usize, TlsX25519NegotiationError>

Validates and commits the server EncryptedExtensions flight. The current

no-PSK profile supports empty extensions, SNI acknowledgement, supported_groups and one ALPN selection that exactly appeared in the committed ClientHello. All other semantics fail closed.

Receiver: self: &TlsX25519Negotiation! (mutable reference)

Parameters:

NameType
encodedSpan<u8>

Returns: Result<usize, TlsX25519NegotiationError>


selectedAlpnLen 🔓 export ​

📄 negotiation.vx L1292-1299

vex
export fn (self: &TlsX25519Negotiation) selectedAlpnLen(): usize

Returns the authenticated server ALPN selection length after server

Finished. Zero means the client did not negotiate ALPN.

Receiver: self: &TlsX25519Negotiation (immutable reference)

Returns: usize


selectedAlpnTo 🔓 export ​

📄 negotiation.vx L1302-1324

vex
export fn (self: &TlsX25519Negotiation) selectedAlpnTo(output: &Span<u8>!): Result<usize, TlsX25519NegotiationError>

Copies the authenticated ALPN selection to caller storage.

Receiver: self: &TlsX25519Negotiation (immutable reference)

Parameters:

NameType
output&Span<u8>!

Returns: Result<usize, TlsX25519NegotiationError>


acceptServerCertificate 🔓 export ​

📄 negotiation.vx L1329-1410

vex
export fn (self: &TlsX25519Negotiation!) acceptServerCertificate(encoded: Span<u8>, trustAnchor: Span<u8>, referenceDnsName: str, unixSeconds: i64): Result<usize, TlsX25519NegotiationError>

Validates the server Certificate list against an explicit trust anchor,

DNS identity and time, then retains only the authenticated 32-byte Ed25519 key. Borrowed DER spans never survive the call.

Receiver: self: &TlsX25519Negotiation! (mutable reference)

Parameters:

NameType
encodedSpan<u8>
trustAnchorSpan<u8>
referenceDnsNamestr
unixSecondsi64

Returns: Result<usize, TlsX25519NegotiationError>


acceptServerCertificateVerify 🔓 export ​

📄 negotiation.vx L1415-1447

vex
export fn (self: &TlsX25519Negotiation!) acceptServerCertificateVerify(encoded: Span<u8>): Result<usize, TlsX25519NegotiationError>

Verifies and commits server CertificateVerify only when Ed25519 was offered

by the exact committed ClientHello and the certificate path supplied the authenticated key.

Receiver: self: &TlsX25519Negotiation! (mutable reference)

Parameters:

NameType
encodedSpan<u8>

Returns: Result<usize, TlsX25519NegotiationError>


failAuthenticatedFlight ​

📄 negotiation.vx L1449-1458

vex
fn (self: &TlsX25519Negotiation!) failAuthenticatedFlight()

Receiver: self: &TlsX25519Negotiation! (mutable reference)


acceptServerFinished 🔓 export ​

📄 negotiation.vx L1464-1547

vex
export fn (self: &TlsX25519Negotiation!) acceptServerFinished(encoded: Span<u8>, clientApplicationOut: &Span<u8>!, serverApplicationOut: &Span<u8>!): Result<usize, TlsX25519NegotiationError>

Constant-time verifies and commits the peer Finished, then derives

generation-0 application traffic secrets from the transcript through that message. Caller outputs are written only after the schedule transition has fully succeeded.

Receiver: self: &TlsX25519Negotiation! (mutable reference)

Parameters:

NameType
encodedSpan<u8>
clientApplicationOut&Span<u8>!
serverApplicationOut&Span<u8>!

Returns: Result<usize, TlsX25519NegotiationError>


writeClientFinished 🔓 export ​

📄 negotiation.vx L1552-1619

vex
export fn (self: &TlsX25519Negotiation!) writeClientFinished(output: &Span<u8>!): Result<usize, TlsX25519NegotiationError>

Emits and commits the client's Finished message. Application traffic was

already derived at the RFC 8446 server-Finished boundary; this final gate retires both handshake traffic secrets and marks the owner complete.

Receiver: self: &TlsX25519Negotiation! (mutable reference)

Parameters:

NameType
output&Span<u8>!

Returns: Result<usize, TlsX25519NegotiationError>


drop 🔓 export ​

📄 negotiation.vx L1621-1636

vex
export fn (self: &TlsX25519Negotiation!) drop()

Receiver: self: &TlsX25519Negotiation! (mutable reference)


isKind 🔓 export ​

📄 record.vx L49-51

vex
export fn (self: &TlsRecordError) isKind(kind: TlsRecordError): bool

Receiver: self: &TlsRecordError (immutable reference)

Parameters:

NameType
kindTlsRecordError

Returns: bool


TlsCipherState.new 🔓 export ​

📄 record.vx L94-127

vex
export fn TlsCipherState.new(cipherId: u16, key: Span<u8>, iv: Span<u8>): Result<TlsCipherState, TlsRecordError>

Usage contract: Copies key/IV into a move-only sequence-zero owner and erases them on drop. Do not reconstruct this owner with an old traffic key/IV to reset the nonce sequence. This constructor does not perform a handshake.

Parameters:

NameTypeDescription
cipherIdu16Supported TLS AES-128-GCM, AES-256-GCM or ChaCha20-Poly1305 suite ID
keySpan<u8>Exactly 16 bytes for AES-128 or 32 for the other supported suites
ivSpan<u8>Exactly 12 traffic-IV bytes derived by the handshake schedule

Returns: Result<TlsCipherState, TlsRecordError>


sequence 🔓 export ​

📄 record.vx L129-129

vex
export fn (self: &TlsCipherState) sequence(): u64

Receiver: self: &TlsCipherState (immutable reference)

Returns: u64


validateRekeyMaterial ​

📄 record.vx L137-160

vex
fn (self: &TlsCipherState) validateRekeyMaterial(key: Span<u8>, iv: Span<u8>): Result<bool, TlsRecordError>

Atomically installs the next key generation for this direction.

All validation completes before the current key/IV are erased. Once the caller has derived and staged exact replacement material, the remaining commit consists only of infallible fixed-size copies and a sequence reset. Cipher identity and key width cannot change across a TLS 1.3 KeyUpdate.

Receiver: self: &TlsCipherState (immutable reference)

Parameters:

NameType
keySpan<u8>
ivSpan<u8>

Returns: Result<bool, TlsRecordError>


commitRekey ​

📄 record.vx L162-174

vex
fn (self: &TlsCipherState!) commitRekey(key: Span<u8>, iv: Span<u8>)

Receiver: self: &TlsCipherState! (mutable reference)

Parameters:

NameType
keySpan<u8>
ivSpan<u8>

rekey 🔓 export ​

📄 record.vx L176-185

vex
export fn (self: &TlsCipherState!) rekey(key: Span<u8>, iv: Span<u8>): Result<bool, TlsRecordError>

Receiver: self: &TlsCipherState! (mutable reference)

Parameters:

NameType
keySpan<u8>
ivSpan<u8>

Returns: Result<bool, TlsRecordError>


retire 🔓 export ​

📄 record.vx L190-195

vex
export fn (self: &TlsCipherState!) retire()

Irreversibly erases this direction's traffic key and IV. Transport owners

call this immediately when a half-close or fatal failure makes the direction unusable; Drop remains an idempotent final backstop.

Receiver: self: &TlsCipherState! (mutable reference)


drop 🔓 export ​

📄 record.vx L197-197

vex
export fn (self: &TlsCipherState!) drop()

Receiver: self: &TlsCipherState! (mutable reference)


keyBuf ​

📄 record.vx L199-201

vex
fn (self: &TlsCipherState) keyBuf(): RawBuf

Receiver: self: &TlsCipherState (immutable reference)

Returns: RawBuf


ivBuf ​

📄 record.vx L203-205

vex
fn (self: &TlsCipherState) ivBuf(): RawBuf

Receiver: self: &TlsCipherState (immutable reference)

Returns: RawBuf


encryptRecord 🔓 export ​

📄 record.vx L261-340

vex
export fn (self: &TlsCipherState!) encryptRecord(contentType: u8, plaintext: Span<u8>, outRecord: &Span<u8>!): Result<usize, TlsRecordError>

Usage contract: Returns the complete encoded record length. Capacity/overlap/sequence checks occur before encryption; sequence advances only after successful record emission into the buffer. The caller must still send that exact prefix in order.

Receiver: self: &TlsCipherState! (mutable reference)

Parameters:

NameTypeDescription
contentTypeu8A supported TLS inner content type
plaintextSpan<u8>Borrowed application/handshake/alert bytes, at most 16384 bytes
outRecord&Span<u8>!Writable span of at least plaintext length + 22 bytes; disjoint from input

Returns: Result<usize, TlsRecordError>


encryptRecordThenRekey 🔓 export ​

📄 record.vx L349-363

vex
export fn (self: &TlsCipherState!) encryptRecordThenRekey(contentType: u8, plaintext: Span<u8>, outRecord: &Span<u8>!, nextKey: Span<u8>, nextIv: Span<u8>): Result<usize, TlsRecordError>

Encrypts one record under the current generation and atomically installs

the staged next-generation key/IV after ciphertext commit. Replacement material is fully validated before record encryption. If any capacity, overlap or cipher operation fails, neither sequence nor key generation changes. After successful encryption, the fixed-size rekey commit is infallible and resets the sequence to zero for the next record.

Receiver: self: &TlsCipherState! (mutable reference)

Parameters:

NameType
contentTypeu8
plaintextSpan<u8>
outRecord&Span<u8>!
nextKeySpan<u8>
nextIvSpan<u8>

Returns: Result<usize, TlsRecordError>


decryptRecord 🔓 export ​

📄 record.vx L365-451

vex
export fn (self: &TlsCipherState!) decryptRecord(record: Span<u8>, outPlain: &Span<u8>!): Result<TlsPlaintext, TlsRecordError>

Usage contract: Only Ok exposes authenticated contentType/length; consume that prefix, not the whole scratch span. Authentication or inner-content failure clears candidate plaintext and does not advance the receive sequence. This low-level owner does not drive connection teardown; TlsApplicationTraffic owns transport-failure policy.

Receiver: self: &TlsCipherState! (mutable reference)

Parameters:

NameTypeDescription
recordSpan<u8>One complete encoded TLS record, including its five-byte header and tag
outPlain&Span<u8>!Writable plaintext scratch of at least record payload length minus 16 tag bytes; disjoint from ciphertext

Returns: Result<TlsPlaintext, TlsRecordError>


isKind 🔓 export ​

📄 transcript.vx L32-34

vex
export fn (self: &TlsTranscriptError) isKind(kind: TlsTranscriptError): bool

Receiver: self: &TlsTranscriptError (immutable reference)

Parameters:

NameType
kindTlsTranscriptError

Returns: bool


TlsTranscript.new 🔓 export ​

📄 transcript.vx L112-133

vex
export fn TlsTranscript.new(byteLimit: usize): Result<TlsTranscript, TlsTranscriptError>

Constructs a dual SHA-256/SHA-384 transcript with an explicit resource

limit. Both states receive pre-negotiation messages; selectHash retires the unused state once the cipher suite is known. The hard ceiling prevents a caller-controlled configuration from disabling boundedness.

Parameters:

NameType
byteLimitusize

Returns: Result<TlsTranscript, TlsTranscriptError>


TlsTranscript.newForHash 🔓 export ​

📄 transcript.vx L136-147

vex
export fn TlsTranscript.newForHash(hash: TlsHashAlgorithm, byteLimit: usize): Result<TlsTranscript, TlsTranscriptError>

Constructs a transcript whose cipher-suite hash is already known.

Parameters:

NameType
hashTlsHashAlgorithm
byteLimitusize

Returns: Result<TlsTranscript, TlsTranscriptError>


TlsTranscript.withDefaultLimit 🔓 export ​

📄 transcript.vx L150-155

vex
export fn TlsTranscript.withDefaultLimit(): TlsTranscript

Constructs a dual transcript with the 16 MiB default input budget.

Returns: TlsTranscript


TlsTranscript.withDefaultHash 🔓 export ​

📄 transcript.vx L158-163

vex
export fn TlsTranscript.withDefaultHash(hash: TlsHashAlgorithm): TlsTranscript

Constructs a selected-hash transcript with the 16 MiB default budget.

Parameters:

NameType
hashTlsHashAlgorithm

Returns: TlsTranscript


selectedHash 🔓 export ​

📄 transcript.vx L166-169

vex
export fn (self: &TlsTranscript) selectedHash(): Option<TlsHashAlgorithm>

Returns the committed suite hash, or None while both candidates are live.

Receiver: self: &TlsTranscript (immutable reference)

Returns: Option<TlsHashAlgorithm>


limit 🔓 export ​

📄 transcript.vx L172-172

vex
export fn (self: &TlsTranscript) limit(): usize

Returns the immutable accepted-input byte budget.

Receiver: self: &TlsTranscript (immutable reference)

Returns: usize


acceptedLen 🔓 export ​

📄 transcript.vx L175-175

vex
export fn (self: &TlsTranscript) acceptedLen(): usize

Returns bytes accepted from complete peer/local Handshake messages.

Receiver: self: &TlsTranscript (immutable reference)

Returns: usize


hashedLen 🔓 export ​

📄 transcript.vx L178-178

vex
export fn (self: &TlsTranscript) hashedLen(): usize

Returns the effective bytes represented by the running hash state.

Receiver: self: &TlsTranscript (immutable reference)

Returns: usize


messages 🔓 export ​

📄 transcript.vx L181-181

vex
export fn (self: &TlsTranscript) messages(): usize

Returns the number of effective messages in the running transcript.

Receiver: self: &TlsTranscript (immutable reference)

Returns: usize


lastMessage 🔓 export ​

📄 transcript.vx L185-188

vex
export fn (self: &TlsTranscript) lastMessage(): Option<u8>

Returns the most recently committed Handshake type. An empty transcript

has no last message, so callers cannot confuse the numeric zero with state.

Receiver: self: &TlsTranscript (immutable reference)

Returns: Option<u8>


didRewriteHelloRetry 🔓 export ​

📄 transcript.vx L191-191

vex
export fn (self: &TlsTranscript) didRewriteHelloRetry(): bool

Reports whether the ClientHello1 synthetic-hash rewrite was committed.

Receiver: self: &TlsTranscript (immutable reference)

Returns: bool


drop 🔓 export ​

📄 transcript.vx L193-198

vex
export fn (self: &TlsTranscript!) drop()

Receiver: self: &TlsTranscript! (mutable reference)


absorbRaw ​

📄 transcript.vx L200-210

vex
fn (self: &TlsTranscript!) absorbRaw(input: RawBuf, length: usize)

Receiver: self: &TlsTranscript! (mutable reference)

Parameters:

NameType
inputRawBuf
lengthusize

selectHash 🔓 export ​

📄 transcript.vx L227-251

vex
export fn (self: &TlsTranscript!) selectHash(hash: TlsHashAlgorithm): Result<bool, TlsTranscriptError>

Commits the cipher-suite hash. Re-selecting the same hash is idempotent;

changing it after commitment is rejected. The unused state is erased.

Receiver: self: &TlsTranscript! (mutable reference)

Parameters:

NameType
hashTlsHashAlgorithm

Returns: Result<bool, TlsTranscriptError>


validateAppend ​

📄 transcript.vx L253-265

vex
fn (self: &TlsTranscript) validateAppend(messageType: u8, encodedLen: usize): Result<bool, TlsTranscriptError>

Receiver: self: &TlsTranscript (immutable reference)

Parameters:

NameType
messageTypeu8
encodedLenusize

Returns: Result<bool, TlsTranscriptError>


commitMessage ​

📄 transcript.vx L267-278

vex
fn (self: &TlsTranscript!) commitMessage(messageType: u8, encoded: RawBuf, encodedLen: usize)

Receiver: self: &TlsTranscript! (mutable reference)

Parameters:

NameType
messageTypeu8
encodedRawBuf
encodedLenusize

appendEncoded 🔓 export ​

📄 transcript.vx L283-300

vex
export fn (self: &TlsTranscript!) appendEncoded(encoded: Span<u8>): Result<usize, TlsTranscriptError>

Validates and appends one complete encoded TLS Handshake message. The

uint24 length must exactly match the supplied span; record headers must not be included.

Receiver: self: &TlsTranscript! (mutable reference)

Parameters:

NameType
encodedSpan<u8>

Returns: Result<usize, TlsTranscriptError>


appendMessage 🔓 export ​

📄 transcript.vx L304-336

vex
export fn (self: &TlsTranscript!) appendMessage(messageType: u8, body: Span<u8>): Result<usize, TlsTranscriptError>

Appends a body while generating the authenticated handshake header. This

is the preferred construction path and performs no temporary allocation.

Receiver: self: &TlsTranscript! (mutable reference)

Parameters:

NameType
messageTypeu8
bodySpan<u8>

Returns: Result<usize, TlsTranscriptError>


digestTo 🔓 export ​

📄 transcript.vx L340-345

vex
export fn (self: &TlsTranscript) digestTo(output: &Span<u8>!): Result<usize, TlsTranscriptError>

Writes the current transcript hash without finalizing the running state.

A later message can therefore be appended after any number of snapshots.

Receiver: self: &TlsTranscript (immutable reference)

Parameters:

NameType
output&Span<u8>!

Returns: Result<usize, TlsTranscriptError>


digestFor 🔓 export ​

📄 transcript.vx L349-372

vex
export fn (self: &TlsTranscript) digestFor(hash: TlsHashAlgorithm, output: &Span<u8>!): Result<usize, TlsTranscriptError>

Snapshots either candidate hash before cipher-suite selection. After

selection, only the committed hash remains available.

Receiver: self: &TlsTranscript (immutable reference)

Parameters:

NameType
hashTlsHashAlgorithm
output&Span<u8>!

Returns: Result<usize, TlsTranscriptError>


rewriteForHelloRetryRequest 🔓 export ​

📄 transcript.vx L379-415

vex
export fn (self: &TlsTranscript!) rewriteForHelloRetryRequest(): Result<usize, TlsTranscriptError>

Applies RFC 8446 section 4.4.1's HelloRetryRequest rewrite.

This operation is legal exactly once and only while the transcript contains one complete ClientHello. The accepted-byte budget remains monotonic while the effective hash state becomes message_hash || Hash(ClientHello1).

Receiver: self: &TlsTranscript! (mutable reference)

Returns: Result<usize, TlsTranscriptError>


isKind 🔓 export ​

📄 transport.vx L74-76

vex
export fn (self: &TlsTransportError) isKind(kind: TlsTransportErrorKind): bool

Receiver: self: &TlsTransportError (immutable reference)

Parameters:

NameType
kindTlsTransportErrorKind

Returns: bool


TlsApplicationTraffic.new 🔓 export ​

📄 transport.vx L178-281

vex
export fn TlsApplicationTraffic.new(cipherId: u16, sendSecret: Span<u8>, receiveSecret: Span<u8>): Result<TlsApplicationTraffic, TlsTransportError>

Parameters:

NameType
cipherIdu16
sendSecretSpan<u8>
receiveSecretSpan<u8>

Returns: Result<TlsApplicationTraffic, TlsTransportError>


state 🔓 export ​

📄 transport.vx L283-291

vex
export fn (self: &TlsApplicationTraffic) state(): TlsTransportState

Receiver: self: &TlsApplicationTraffic (immutable reference)

Returns: TlsTransportState


sendSequence 🔓 export ​

📄 transport.vx L293-295

vex
export fn (self: &TlsApplicationTraffic) sendSequence(): u64

Receiver: self: &TlsApplicationTraffic (immutable reference)

Returns: u64


receiveSequence 🔓 export ​

📄 transport.vx L297-299

vex
export fn (self: &TlsApplicationTraffic) receiveSequence(): u64

Receiver: self: &TlsApplicationTraffic (immutable reference)

Returns: u64


sendGeneration 🔓 export ​

📄 transport.vx L301-303

vex
export fn (self: &TlsApplicationTraffic) sendGeneration(): u64

Receiver: self: &TlsApplicationTraffic (immutable reference)

Returns: u64


receiveGeneration 🔓 export ​

📄 transport.vx L305-307

vex
export fn (self: &TlsApplicationTraffic) receiveGeneration(): u64

Receiver: self: &TlsApplicationTraffic (immutable reference)

Returns: u64


keyUpdateResponseRequired 🔓 export ​

📄 transport.vx L309-311

vex
export fn (self: &TlsApplicationTraffic) keyUpdateResponseRequired(): bool

Receiver: self: &TlsApplicationTraffic (immutable reference)

Returns: bool


drop ​

📄 transport.vx L320-325

vex
fn (self: &TlsNextTrafficGeneration!) drop()

Receiver: self: &TlsNextTrafficGeneration! (mutable reference)


retireSendDirection ​

📄 transport.vx L355-358

vex
fn (self: &TlsApplicationTraffic!) retireSendDirection()

Receiver: self: &TlsApplicationTraffic! (mutable reference)


retireReceiveDirection ​

📄 transport.vx L360-365

vex
fn (self: &TlsApplicationTraffic!) retireReceiveDirection()

Receiver: self: &TlsApplicationTraffic! (mutable reference)


retireFailed ​

📄 transport.vx L367-372

vex
fn (self: &TlsApplicationTraffic!) retireFailed()

Receiver: self: &TlsApplicationTraffic! (mutable reference)


encryptApplicationData 🔓 export ​

📄 transport.vx L374-391

vex
export fn (self: &TlsApplicationTraffic!) encryptApplicationData(plaintext: Span<u8>, output: &Span<u8>!): Result<usize, TlsTransportError>

Receiver: self: &TlsApplicationTraffic! (mutable reference)

Parameters:

NameType
plaintextSpan<u8>
output&Span<u8>!

Returns: Result<usize, TlsTransportError>


writeKeyUpdate 🔓 export ​

📄 transport.vx L397-450

vex
export fn (self: &TlsApplicationTraffic!) writeKeyUpdate(request: TlsKeyUpdateRequest, output: &Span<u8>!): Result<usize, TlsTransportError>

Sends a complete KeyUpdate under the current send generation and commits

generation N+1 only after the old-key ciphertext is available to transmit. A requested peer update creates a response obligation; application data is blocked until an UpdateNotRequested response has crossed this boundary.

Receiver: self: &TlsApplicationTraffic! (mutable reference)

Parameters:

NameType
requestTlsKeyUpdateRequest
output&Span<u8>!

Returns: Result<usize, TlsTransportError>


writeAlertPayload ​

📄 transport.vx L452-476

vex
fn (self: &TlsApplicationTraffic!) writeAlertPayload(alert: TlsAlert, output: &Span<u8>!): Result<usize, TlsTransportError>

Receiver: self: &TlsApplicationTraffic! (mutable reference)

Parameters:

NameType
alertTlsAlert
output&Span<u8>!

Returns: Result<usize, TlsTransportError>


writeUserCanceled 🔓 export ​

📄 transport.vx L481-493

vex
export fn (self: &TlsApplicationTraffic!) writeUserCanceled(output: &Span<u8>!): Result<usize, TlsTransportError>

Sends the TLS 1.3 user_canceled warning once without retiring the send key.

Application data is forbidden afterward; the only orderly continuation is close_notify, while a newly discovered fatal error may still be reported.

Receiver: self: &TlsApplicationTraffic! (mutable reference)

Parameters:

NameType
output&Span<u8>!

Returns: Result<usize, TlsTransportError>


writeCloseNotify 🔓 export ​

📄 transport.vx L498-511

vex
export fn (self: &TlsApplicationTraffic!) writeCloseNotify(output: &Span<u8>!): Result<usize, TlsTransportError>

Encrypts close_notify exactly once, then erases the send-direction key.

A failed capacity/overlap check leaves the direction open so the caller can retry with valid storage; a cryptographic failure retires both directions.

Receiver: self: &TlsApplicationTraffic! (mutable reference)

Parameters:

NameType
output&Span<u8>!

Returns: Result<usize, TlsTransportError>


writeFatalAlert 🔓 export ​

📄 transport.vx L516-532

vex
export fn (self: &TlsApplicationTraffic!) writeFatalAlert(description: TlsAlertDescription, output: &Span<u8>!): Result<usize, TlsTransportError>

Emits one fatal alert and immediately retires both directions after the

ciphertext is committed. close_notify/user_canceled cannot be mislabeled as fatal through this API.

Receiver: self: &TlsApplicationTraffic! (mutable reference)

Parameters:

NameType
descriptionTlsAlertDescription
output&Span<u8>!

Returns: Result<usize, TlsTransportError>


readKeyUpdateFragment ​

📄 transport.vx L534-627

vex
fn (self: &TlsApplicationTraffic!) readKeyUpdateFragment(fragment: Span<u8>): Result<TlsTransportEvent, TlsTransportError>

Receiver: self: &TlsApplicationTraffic! (mutable reference)

Parameters:

NameType
fragmentSpan<u8>

Returns: Result<TlsTransportEvent, TlsTransportError>


readRecord 🔓 export ​

📄 transport.vx L632-719

vex
export fn (self: &TlsApplicationTraffic!) readRecord(record: Span<u8>, plaintext: &Span<u8>!): Result<TlsTransportEvent, TlsTransportError>

Authenticates and classifies one protected application-phase record.

Unknown/malformed alerts, malformed KeyUpdate flights, and application data after peer close/cancel retire the connection.

Receiver: self: &TlsApplicationTraffic! (mutable reference)

Parameters:

NameType
recordSpan<u8>
plaintext&Span<u8>!

Returns: Result<TlsTransportEvent, TlsTransportError>


drop 🔓 export ​

📄 transport.vx L721-726

vex
export fn (self: &TlsApplicationTraffic!) drop()

Receiver: self: &TlsApplicationTraffic! (mutable reference)


isKind 🔓 export ​

📄 x509.vx L52-54

vex
export fn (self: &X509Error) isKind(kind: X509ErrorKind): bool

Receiver: self: &X509Error (immutable reference)

Parameters:

NameType
kindX509ErrorKind

Returns: bool


X509CertificateView.parse 🔓 export ​

📄 x509.vx L145-346

vex
export fn X509CertificateView.parse(input: Span<u8>): Result<X509CertificateView, X509Error>

Parses the structural certificate envelope and admits only RFC 8410

Ed25519 signature/SPKI identities. Other algorithms fail explicitly.

Parameters:

NameType
inputSpan<u8>

Returns: Result<X509CertificateView, X509Error>


publicKeyBytes 🔓 export ​

📄 x509.vx L348-355

vex
export fn (self: &X509CertificateView) publicKeyBytes(input: Span<u8>): Result<Span<u8>, X509Error>

Receiver: self: &X509CertificateView (immutable reference)

Parameters:

NameType
inputSpan<u8>

Returns: Result<Span<u8>, X509Error>


verifySignatureWith 🔓 export ​

📄 x509.vx L359-377

vex
export fn (self: &X509CertificateView) verifySignatureWith(input: Span<u8>, issuerInput: Span<u8>, issuer: &X509CertificateView): Result<bool, X509Error>

Verifies this certificate signature with the issuer's Ed25519 SPKI. Chain

policy (name chaining, CA constraints, time and trust anchor) is separate.

Receiver: self: &X509CertificateView (immutable reference)

Parameters:

NameType
inputSpan<u8>
issuerInputSpan<u8>
issuer&X509CertificateView

Returns: Result<bool, X509Error>


validityRange 🔓 export ​

📄 x509.vx L482-511

vex
export fn (self: &X509CertificateView) validityRange(input: Span<u8>): Result<(i64, i64), X509Error>

Receiver: self: &X509CertificateView (immutable reference)

Parameters:

NameType
inputSpan<u8>

Returns: Result<(i64, i64), X509Error>


validateAt 🔓 export ​

📄 x509.vx L513-526

vex
export fn (self: &X509CertificateView) validateAt(input: Span<u8>, unixSeconds: i64): Result<bool, X509Error>

Receiver: self: &X509CertificateView (immutable reference)

Parameters:

NameType
inputSpan<u8>
unixSecondsi64

Returns: Result<bool, X509Error>


X509TlsServerVerifier.verifyChain 🔓 export ​

📄 x509.vx L1002-1065

vex
export fn X509TlsServerVerifier.verifyChain(leafInput: Span<u8>, intermediateInputs: Span<Span<u8>>, trustAnchorInput: Span<u8>, referenceDnsName: str, unixSeconds: i64): Result<bool, X509Error>

Usage contract: Returns Ok(true) only when the bounded Ed25519 path and DNS policy succeed; errors reject the chain. It does not provide general PKIX, revocation, RSA or P-256 validation. See certificate substrate.

Parameters:

NameTypeDescription
leafInputSpan<u8>Borrowed DER leaf certificate bytes
intermediateInputsSpan<Span<u8>>Up to eight borrowed DER spans in leaf-to-anchor order
trustAnchorInputSpan<u8>Explicit caller-trusted DER anchor; no implicit OS root lookup
referenceDnsNamestrDNS reference identity to compare against leaf subjectAltName
unixSecondsi64Current validation time as signed Unix seconds

Returns: Result<bool, X509Error>


X509TlsServerVerifier.verifyDirect 🔓 export ​

📄 x509.vx L1068-1076

vex
export fn X509TlsServerVerifier.verifyDirect(leafInput: Span<u8>, trustAnchorInput: Span<u8>, referenceDnsName: str, unixSeconds: i64): Result<bool, X509Error>

Convenience path for a leaf signed directly by the explicit trust anchor.

Parameters:

NameType
leafInputSpan<u8>
trustAnchorInputSpan<u8>
referenceDnsNamestr
unixSecondsi64

Returns: Result<bool, X509Error>


dnsNameCount 🔓 export ​

📄 x509.vx L1121-1145

vex
export fn (self: &X509CertificateView) dnsNameCount(input: Span<u8>): Result<usize, X509Error>

Receiver: self: &X509CertificateView (immutable reference)

Parameters:

NameType
inputSpan<u8>

Returns: Result<usize, X509Error>


dnsNameAt 🔓 export ​

📄 x509.vx L1147-1177

vex
export fn (self: &X509CertificateView) dnsNameAt(input: Span<u8>, wanted: usize): Result<Span<u8>, X509Error>

Receiver: self: &X509CertificateView (immutable reference)

Parameters:

NameType
inputSpan<u8>
wantedusize

Returns: Result<Span<u8>, X509Error>


matchesDnsName 🔓 export ​

📄 x509.vx L1181-1204

vex
export fn (self: &X509CertificateView) matchesDnsName(input: Span<u8>, reference: str): Result<bool, X509Error>

Checks every SAN dNSName. Invalid presented identities fail closed instead

of being silently skipped. Absence never falls back to subject CN.

Receiver: self: &X509CertificateView (immutable reference)

Parameters:

NameType
inputSpan<u8>
referencestr

Returns: Result<bool, X509Error>



Generated by vex-doc v2.0 • 2026-10-28

Released under the MIT License.