(pub_raw: bytes, msg: bytes, ctx: bytes)
| 165 | |
| 166 | |
| 167 | def _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[ |
no test coverage detected