MCPcopy
hub / github.com/pyca/cryptography / _compute_mu

Function _compute_mu

tests/wycheproof/test_mldsa.py:167–172  ·  view source on GitHub ↗
(pub_raw: bytes, msg: bytes, ctx: bytes)

Source from the content-addressed store, hash-verified

165
166
167def _compute_mu(pub_raw: bytes, msg: bytes, ctx: bytes) -> bytes:
168 # FIPS 204: mu = SHAKE256(SHAKE256(pk, 64) || M', 64) where for pure
169 # ML-DSA M' = 0x00 || len(ctx) || ctx || M.
170 tr = hashlib.shake_256(pub_raw).digest(64)
171 m_prime = b"\x00" + bytes([len(ctx)]) + ctx + msg
172 return hashlib.shake_256(tr + m_prime).digest(64)
173
174
175_MLDSA_PUBLIC_KEYS: dict[

Callers 1

test_mldsa_external_muFunction · 0.85

Calls 1

digestMethod · 0.45

Tested by

no test coverage detected