@blockchaincommons/crypto - v1.0.0-beta.3
    Preparing search index...

      @blockchaincommons/crypto - v1.0.0-beta.3

      @blockchaincommons/crypto - the cryptographic primitives the Blockchain Commons stack is built on, over the noble libraries.

      • Hashes and KDFs as free functions: sha256, hmacSha256, hkdfSha256, pbkdf2Sha256, scrypt, argon2id, crc32.
      • Algorithm families as objects: chacha20Poly1305, x25519, ecdsa, schnorr, ed25519; each carries its own size constants (ecdsa.PRIVATE_KEY_SIZE, chacha20Poly1305.TAG_SIZE).
      • The stack's two key derivations at the root: deriveSigningPrivateKey and deriveAgreementPrivateKey.
      • 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.
      CryptoError
      AeadOptions
      Chacha20Poly1305
      Ecdsa
      SchnorrSignOptions
      Schnorr
      Ed25519
      Crc32Options
      Pbkdf2Options
      HkdfOptions
      ScryptOptions
      Argon2idOptions
      Chacha20Options
      X25519
      CryptoErrorCode
      CryptoErrorDetails
      NumericTypedArray
      chacha20Poly1305
      ecdsa
      schnorr
      ed25519
      CRC32_SIZE
      SHA256_SIZE
      SHA512_SIZE
      x25519
      crc32
      crc32Bytes
      sha256
      doubleSha256
      sha512
      hmacSha256
      hmacSha512
      pbkdf2Sha256
      pbkdf2Sha512
      hkdfSha256
      hkdfSha512
      scrypt
      argon2id
      memzero
      memzeroAll
      chacha20
      deriveSigningPrivateKey
      deriveAgreementPrivateKey