Expand description
Provider-neutral cryptography for the webrtc-rs RTC stack.
The open traits in this crate allow applications to supply cryptography and randomness without registering global state. Built-in providers are selected with additive Cargo features.
Modules§
- conformance
- Reusable conformance assertions for built-in and application-provided crypto providers.
- providers
Structs§
- Public
Key - Borrowed public-key bytes with an explicit encoding.
- Secret
Vec - An owned byte vector that zeroizes its allocation when dropped.
Enums§
- Aead
Algorithm - Authenticated-encryption algorithms.
- Block
Cipher Algorithm - Single-block encryption algorithms.
- CbcAlgorithm
- CBC algorithms.
- Crypto
Algorithm - A provider capability identifier.
- Crypto
Error - A provider-neutral cryptographic failure.
- Hash
Algorithm - Algorithms accepted by
crate::RTCCrypto::hash. - Header
Mask Algorithm - The ciphers a record-number (header-protection) mask is made with: the block cipher or stream cipher underneath an AEAD, keyed separately (RFC 9147 section 4.2.3; the same construction as QUIC header protection, RFC 9001 section 5.4).
- Hmac
Algorithm - Algorithms accepted by the HMAC operations.
- KeyExchange
Algorithm - Ephemeral key-agreement algorithms.
- Public
KeyEncoding - The encoding of public-key bytes.
- Signature
Scheme - Signature schemes currently used by DTLS.
- Stream
Cipher Algorithm - Stream-cipher algorithms.
Constants§
- HEADER_
MASK_ LEN - The length of the mask a
HeaderMaskreturns. - HEADER_
MASK_ SAMPLE_ LEN - The length of the ciphertext sample a
HeaderMaskis computed from.
Traits§
- Active
KeyExchange - Provider-owned one-shot ephemeral key exchange.
- Aead
Cipher - A keyed authenticated cipher with detached tags.
- CbcCipher
- A keyed CBC block cipher with a reusable expanded key.
- Header
Mask - A keyed generator of record-number masks.
- Mac
- A keyed message authentication code with a reusable key schedule.
- RTCCrypto
- Provider-neutral cryptographic operations.
- RTCCrypto
Provider - A bundle of cryptographic operations and cryptographically secure randomness.
- RTCRandom
- A cryptographically secure random byte generator.
- Signing
Key - A provider-owned signing key, including external or non-exportable keys.
- Stream
Cipher - A keyed stream cipher with a reusable expanded key.
Functions§
- constant_
time_ eq - Compares equal-length byte strings without data-dependent early exit.
- default_
provider - Constructs the built-in default provider.
- hkdf_
expand HKDF-Expand(PRK, info, L)(RFC 5869 section 2.3),infogiven in pieces.- hkdf_
expand_ label HKDF-Expand-Label(Secret, Label, Context, Length)(RFC 8446 section 7.1): HKDF-Expand with theHkdfLabelstructure as info.prefixis what the label is prefixed with on the wire:"tls13 "for TLS 1.3 and"dtls13"for DTLS 1.3 (RFC 9147 section 5.9).- hkdf_
extract HKDF-Extract(salt, IKM)(RFC 5869 section 2.2): the pseudorandom key, one digest long.- rsa_
pkcs1_ hash - The hash an RSASSA-PKCS1-v1_5 scheme signs with;
Nonefor any other scheme. - verify_
rsa_ pkcs1_ without_ digest_ parameters - Verifies an RSASSA-PKCS1-v1_5
signatureover the message whosedigest(made withrsa_pkcs1_hashofscheme) is given, for the DigestInfo encoding WITHOUT the NULL parameters (RFC 5246 section 4.7).public_keyis the DERRSAPublicKey. The form with NULL parameters is the provider’s (crate::RTCCrypto::verify_signature); this one accepts only the other.