HashApi class abstract interface

Constructs hash and HMAC instances for the supported algorithms.

Implementers

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

blake2b({int digestLength = 64, Blake2Config? config}) → BuSerializableHash<BuHashState>
BLAKE2b with digestLength 1..64 bytes (default 64). Throws on out-of-range length.
blake2s({int digestLength = 32, Blake2Config? config}) → BuSerializableHash<BuHashState>
BLAKE2s with digestLength 1..32 bytes (default 32). Throws on out-of-range length.
hmacSha256(List<int> key) → BuSerializableHash<BuHashState>
HMAC HMAC-SHA-256 with arbitrary-length key.
hmacSha384(List<int> key) → BuSerializableHash<BuHashState>
HMAC-SHA-384 with arbitrary-length key.
hmacSha512(List<int> key) → BuSerializableHash<BuHashState>
HMAC-SHA-512 with arbitrary-length key.
keccak({int digestLength = 64}) → BuSerializableHash<BuHashState>
Keccak with digestLength 1..64 bytes (default 64 in interface, 32 in Dart backend). Throws on out-of-range length.
keccakF1600(BuBytes src) → BuBytes
Applies the Keccak-f1600 permutation to 200-byte state src. Returns 200-byte state. Throws on crypto failure.
md4() → BuSerializableHash<BuHashState>
MD4, 16-byte digest.
md5() → BuSerializableHash<BuHashState>
MD5, 16-byte digest.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pedersenHash({required int personal, int layer = 0, required BuBytes packedBits, required int bitLen}) → BuBytes
Pedersen hash over packed LSB-first bits → 32-byte Jubjub compressed. personal selects the generator set (0 = note commitment, 1 = Merkle tree at layer); bitLen is the number of significant bits in packedBits. Routes to the active backend (pure-Dart PedersenHash, or native Rust). Throws on crypto failure.
pedersenHashBitstring({required int personal, int layer = 0, required List<bool> bits}) → BuBytes
Pedersen hash of a bit list. Same routing as pedersenHash.
poseidonBn254Hash(List<int> inputs) → BuBytes
circomlib-compatible Poseidon over BN254 Fr (Sui zkLogin / Aptos keyless). inputs is concatenated 32-byte LE Fr elements (1..64); returns the 32-byte LE digest. Native backends built without the Rust poseidon-bn254 feature throw unsupported.
pseudoRando({required List<int> nk, required List<int> rho}) → BuBytes
PRF^nfOrchard(nk, ρ) := Poseidon(nk, ρ) — LE Fp in/out (32 bytes).
ripemd128() → BuSerializableHash<BuHashState>
RIPEMD-128, 16-byte digest.
ripemd160() → BuSerializableHash<BuHashState>
RIPEMD-160, 20-byte digest.
ripemd256() → BuSerializableHash<BuHashState>
RIPEMD-256, 32-byte digest.
ripemd320() → BuSerializableHash<BuHashState>
RIPEMD-320, 40-byte digest.
sha1() → BuSerializableHash<BuHashState>
SHA-1, 20-byte digest.
sha224() → BuSerializableHash<BuHashState>
SHA-224, 28-byte digest.
sha256() → BuSerializableHash<BuHashState>
SHA-256, 32-byte digest.
sha3({int digestLength = 32}) → BuSerializableHash<BuHashState>
SHA-3 with digestLength 1..64 bytes (default 32). Throws on out-of-range length.
sha384() → BuSerializableHash<BuHashState>
SHA-384, 48-byte digest.
sha512() → BuSerializableHash<BuHashState>
SHA-512, 64-byte digest.
sha512256() → BuSerializableHash<BuHashState>
SHA-512/256, 32-byte digest.
shake128() → BuSerializableHash<BuHashState>
SHAKE128 extendable output.
shake256() → BuSerializableHash<BuHashState>
SHAKE256 extendable output.
sinsemillaCommit({required List<int> r, required List<bool> bits, String domain = 'z.cash:Orchard-CommitIvk'}) → BuBytes?
Full Sinsemilla commit → Pasta compressed point, or null as above.
sinsemillaShortCommit({required List<int> r, required List<bool> bits, String domain = 'z.cash:Orchard-CommitIvk'}) → BuBytes?
Sinsemilla shortCommit → LE Fp x, or null only when commit is undefined (Dart incomplete-point / Rust sinsemilla_null). Other failures throw.
toString() → String
A string representation of this object.
inherited
xxHash({int bitLength = 64}) → BuSerializableHash<BuHashState>
XXHash with bitLength 64, 128 or 256 (default 64). Throws on other bit lengths.

Operators

operator ==(Object other) → bool
The equality operator.
inherited