Algorithm families as objects: chacha20Poly1305, x25519,
ecdsa, schnorr, ed25519; each carries its own
size constants (ecdsa.PRIVATE_KEY_SIZE, chacha20Poly1305.TAG_SIZE).
Every failure of an argument or of a primitive is a CryptoError
with a code; a backend's own error, when there is one, is its cause.
Byte arguments must be Uint8Arrays (checked before anything else). A
generator's own error (RandError), and allocation failure outside the
KDFs, propagate as thrown.
Every function that draws randomness takes { rng } (RngOptions
from @blockchaincommons/rand), defaulting to the secure generator.
@blockchaincommons/crypto - the cryptographic primitives the Blockchain Commons stack is built on, over the noble libraries.
ecdsa.PRIVATE_KEY_SIZE,chacha20Poly1305.TAG_SIZE).code; a backend's own error, when there is one, is itscause. Byte arguments must beUint8Arrays (checked before anything else). A generator's own error (RandError), and allocation failure outside the KDFs, propagate as thrown.{ rng }(RngOptions from@blockchaincommons/rand), defaulting to the secure generator.