# @file sig_1_PRF_msg.py
# @version 1.1.0 (2026-02-15T08:23Z)
# @author David Ireland <https://di-mgt.com.au/contact>
# @copyright 2023-26 DI Management Services Pty Ltd
# @license Apache-2.0
"""Generate the 16-byte randomizer R using PRF_msg."""
from slh_sha256 import HMAC_SHA256
# Generate the randomizer R of 16 bytes using hex strings
sk_prf='7A58A951EF7F2B81461DBAC41B5A6B83'
optrand='FA495FB834DEFEA7CC96A81309479135' # <- PK.seed for deterministic
msg= '00003F' # M' = Input msg 0x3F prefixed by two zero bytes
R = HMAC_SHA256(sk_prf, optrand + msg)
R = R[:32] # Truncate to 16 bytes
print("R =", R)
# R = BD40E6D66893F38D5C5FAD99E4885329