ReadonlynameAlways "CryptoError"; the cross-copy identity CryptoError.isCryptoError checks.
ReadonlycodeThe discriminant; equals details.code.
ReadonlydetailsThe structured payload, discriminated by code.
StaticisType guard for a CryptoError, including one from another copy of this package.
Staticinvalidwhat had actual bytes; expected were required.
Staticinvalidwhat has the right length but is not a valid key, point or signature.
Optionalcause: unknownStaticinvalidwhat (a number, an options object or a byte argument) is outside its domain.
Optionalcause: unknownStaticauthenticationAEAD authentication failed (wrong key, nonce, aad, or tampered data).
Optionalcause: unknown
Thrown for wrong-length keys, nonces, signatures and public keys (
InvalidSize), a key, point or signature of the right length that is not valid (InvalidData), an argument outside its domain, including a value of the wrong type (InvalidParameter), and AEAD tag mismatch (AuthenticationFailed).Every failure of an argument or of a primitive is a
CryptoError; when a backend error is what was caught, it is thecause. Two things propagate unwrapped, because they are not this package's: a generator's own error (RandErrorfrom@blockchaincommons/rand, includingInvalidGeneratorfor a generator that lacks a method the draw calls), and an allocation failure outside the KDFs (RangeErrorfrom the engine). Instances come from the static factories only.Example