Skip to Content
oxcrypto
HashesProtocol compatibility

Kupyna

Kupyna digest algorithms.

KUPYNA takes a keyword-only digest_size of 1–64 bytes: up to 32 bytes uses the 512-bit state, above it the 1024-bit state, as in DSTU 7564:2014, which defines outputs in multiples of 8 bits.

Example

from oxcrypto.hash.kupyna import KUPYNA

algorithm = KUPYNA.KUPYNA224
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

  • KUPYNA.KUPYNA224
  • KUPYNA.KUPYNA256
  • KUPYNA.KUPYNA384
  • KUPYNA.KUPYNA512
  • KUPYNA.KUPYNA

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

On this page