unmbt/webstd/crypto does not have a README file

    CryptoError

    pub(all) suberror CryptoError {
    InvalidKeyLength(expected~ : Int, actual~ : Int)
    InvalidNonceLength(expected~ : Int, actual~ : Int)
    InvalidOutputLength(Int)
    InvalidEncoding(String)
    } derive(Eq,
    Debug
    )

    base64url_decode

    fn base64url_decode(input : StringView) -> Bytes raise CryptoError

    RFC 4648 URL-safe Base64 decoding (tolerates optional trailing '=' padding).

    base64url_encode

    fn base64url_encode(data : BytesView) -> String

    RFC 4648 URL-safe Base64 encoding without '=' padding (JWT / PASETO / WebCrypto).

    blake2b

    fn blake2b(data : BytesView, out_len? : Int, key? : BytesView) -> Bytes raise CryptoError

    RFC 7693 BLAKE2b hash/keyed-MAC (1..=64 bytes output, optional 0..=64 bytes key).

    bytes_to_hex

    fn bytes_to_hex(data : BytesView) -> String

    chacha20_xor

    fn chacha20_xor(key~ : BytesView, nonce~ : BytesView, counter? : UInt, data~ : BytesView) -> Bytes raise CryptoError

    RFC 8439 ChaCha20 XOR stream cipher (32-byte key, 12-byte nonce).

    constant_time_equal

    fn constant_time_equal(a : BytesView, b : BytesView) -> Bool

    Constant-time equality check for secret MACs, digests, and tokens.

    hmac_sha256

    fn hmac_sha256(key~ : BytesView, data~ : BytesView) -> Bytes

    RFC 2104 / RFC 4231 HMAC-SHA256 returning 32-byte MAC.

    pbkdf2_hmac_sha256

    fn pbkdf2_hmac_sha256(password~ : BytesView, salt~ : BytesView, iterations~ : Int, dk_len~ : Int) -> Bytes raise CryptoError

    RFC 2898 PBKDF2-HMAC-SHA256 key derivation.

    sha256

    fn sha256(data : BytesView) -> Bytes

    FIPS 180-4 SHA-256 returning 32-byte digest.

    sha256_hex

    fn sha256_hex(data : BytesView) -> String

    xchacha20_xor

    fn xchacha20_xor(key~ : BytesView, nonce~ : BytesView, counter? : UInt, data~ : BytesView) -> Bytes raise CryptoError

    XChaCha20 XOR stream cipher (32-byte key, 24-byte nonce) used by PASETO v4.local.