HashesProtocol compatibility
Grøstl
Grøstl digest algorithms.
GROESTL takes a keyword-only digest_size of 1–64 bytes: up to 32 bytes uses the Grøstl-256 permutation, above it Grøstl-512, as in the specification. Only 224, 256, 384 and 512 bits were submitted to the SHA-3 competition.
Example
from oxcrypto.hash.groestl import GROESTL
algorithm = GROESTL.GROESTL224
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
GROESTL.GROESTL224GROESTL.GROESTL256GROESTL.GROESTL384GROESTL.GROESTL512GROESTL.GROESTL
Methods
digest(self, data: bytes, /, *, digest_size: int | None=None) -> bytes
digest_chunks(self, chunks: Iterable[bytes], /, *, digest_size: int | None=None) -> bytes
new(self, *, digest_size: int | None=None) -> Hasher