Skip to main content

Module hls

Module hls 

Source
Expand description

Four-pass HLS handshake computations for every supported mechanism.

During High Level Security the client processes the server challenge StoC and the server processes the client challenge CtoS; each side verifies the peer’s processed value before the association is established (IEC 62056-5-3 Table 32; Π  1323565.1 Β§7.5).

Each function computes f(challenge) for one mechanism. The GMAC mechanism (5) lives in the Association LN class; the signature mechanisms (7 ECDSA and 10 GOST 34.10) require a private key and are not computed here.

ConstantsΒ§

R_CON πŸ”’
The AES round constants.
S_BOX πŸ”’
The AES S-box.

FunctionsΒ§

aes128_block πŸ”’
AES-128 single-block encryption with on-the-fly key expansion. key is mutated in place to the final round key, matching the reference Aes1Encrypt.
digest_concat πŸ”’
Hashes the concatenation of parts with digest D.
gost_cmac
Mechanism 8 (HLS CMAC, GOST): KUZN_CMAC(LSB256(K_EM), iv β€– SC β€– challenge_a β€– challenge_b).
hash_legacy
Mechanisms 3 (MD5) and 4 (SHA-1): f(challenge) = HASH(challenge β€– secret).
hash_with_titles
Mechanisms 6 (SHA-256) and 9 (Streebog-256): f = HASH(secret β€– st_a β€– st_b β€– challenge_a β€– challenge_b).
manufacturer_aes
HLS mechanism 2 (manufacturer-specific β€œhigh” authentication).
xtime πŸ”’
GF(2^8) xtime multiply-by-2 with the AES reduction polynomial.