Skip to Content
oxcrypto

KECCAK

Pre-standard Keccak digest algorithms.

KECCAK256_FULL returns the 200-byte Keccak state.

Example

from oxcrypto.hash.keccak import KECCAK

algorithm = KECCAK.KECCAK256
digest = algorithm.digest(b"hello")
assert digest == algorithm.digest_chunks([b"he", b"llo"])

hasher = algorithm.new()
hasher.update(b"he")
hasher.update(b"llo")
assert hasher.digest() == digest
print(digest.hex())

Variants

  • KECCAK.KECCAK224
  • KECCAK.KECCAK256
  • KECCAK.KECCAK384
  • KECCAK.KECCAK512
  • KECCAK.KECCAK256_FULL

Methods

digest(self, data: bytes, /) -> bytes
digest_chunks(self, chunks: Iterable[bytes], /) -> bytes
new(self) -> Hasher

On this page