Skip to main content

Crate bssl_crypto

Crate bssl_crypto 

Source
Expand description

Rust BoringSSL bindings

Modules§

aead
Authenticated Encryption with Additional Data.
aes
Advanced Encryption Standard.
cipher
Ciphers.
digest
Hash functions.
ec
Definitions of NIST elliptic curves.
ecdh
Elliptic Curve Diffie-Hellman operations.
ecdsa
Elliptic Curve Digital Signature Algorithm.
ed25519
Ed25519, a signature scheme.
hkdf
Implements the HMAC-based Key Derivation Function from https://datatracker.ietf.org/doc/html/rfc5869.
hmac
Hash-based message authentication from https://datatracker.ietf.org/doc/html/rfc2104.
hpke
Hybrid Public Key Encryption
mldsa
ML-DSA
mlkem
ML-KEM
pkcs8
PKCS#8 support
rsa
RSA signatures.
slhdsa
SLH-DSA-SHA2-128s.
tls12_prf
A special pseudo-random function used by TLS up to version 1.2
x25519
Diffie-Hellman over curve25519.

Structs§

Buffer
Buffer represents an owned chunk of memory on the BoringSSL heap. Call as_ref() to get a &[u8] from it.
InvalidSignatureError
Error type for when a “signature” (either a public-key signature or a MAC) is incorrect.

Traits§

FfiMutSlice
See the comment FfiSlice.
FfiSlice
FfiSlice exists to provide as_ffi_ptr on slices. Calling as_ptr on an empty Rust slice may return the alignment of the type, rather than NULL, as the pointer. When passing pointers into C/C++ code, that is not a valid pointer. Thus this method should be used whenever passing a pointer to a slice into BoringSSL code.

Functions§

cbb_to_buffer
Calls func with a CBB pointer and returns a Buffer of the ultimate contents of that CBB.
constant_time_compare
Returns true iff a and b contain the same bytes. It takes an amount of time dependent on the lengths, but independent of the contents of the slices a and b. The return type is a bool, since unlike memcmp in C this function cannot be used to put elements into a defined order.
rand_array
Returns an array of random bytes.
rand_bytes
Fills buf with random bytes.