GitHub

API reference for native.

Every crypto family on the host's own libraries (Effect's @effect/platform-node NodeCrypto)::

program.pipe(provide(native.layer))

Digests and HMAC run on hashlib and hmac; Argon2id on cryptography (on a worker thread); ChaCha20-Poly1305 on cryptography; the rest on the WebCrypto reference, whose default is the host's. Random bytes come from os.urandom.

Values

AttributeTypeDescription
layer_secure_randomLayer[secure_random.SecureRandom]

Random bytes from the WebCrypto reference (os.urandom by default).

layer_digestLayer[digest.Digest]

Digests on hashlib.

layer_macLayer[mac.Mac]

HMAC on hmac for byte-backed keys.

layer_kdfLayer[kdf.Kdf]

HKDF and PBKDF2 on the WebCrypto reference, Argon2id on cryptography.

layer_aeadLayer[aead.Aead]

AES-GCM on the WebCrypto reference, ChaCha20-Poly1305 on cryptography.

layer_cipherLayer[cipher.Cipher]

Cipher on the host's cryptography, with its own SecureRandom.

layer_signatureLayer[signature_module.Signature]

Signature on the host's cryptography, with its own SecureRandom.

layer_key_agreementLayer[key_agreement.KeyAgreement]

KeyAgreement on the host's cryptography, with its own SecureRandom.

layer_key_wrapLayer[key_wrap.KeyWrap]

KeyWrap on the host's cryptography, with its own SecureRandom.

layerLayer[Services]

Every crypto family.

Types

TypeDefinitionDescription
Servicestype Services = secure_random.SecureRandom | digest.Digest | mac.Mac | kdf.Kdf | aead.Aead | cipher.Cipher | signature_module.Signature | key_agreement.KeyAgreement | key_wrap.KeyWrap