Skip to main content

Module signature

Module signature 

Source
Expand description

Digital-signature HLS mechanisms.

Mechanism 7 (ECDSA) is provided here over the security-suite curves — P-256 for suite 1 and P-384 for suite 2 — hashing with SHA-256 / SHA-384 as the suites specify (IEC 62056-5-3 Table 32). Mechanism 10 (GOST 34.10-2018-256) is in super::gost3410.

During the HLS handshake the message is SystemTitle-a ‖ SystemTitle-b ‖ challenge_a ‖ challenge_b; the signer uses its private key and the verifier the peer’s public key. Public keys may be given either as a raw x ‖ y point or in SEC1 form (with the 0x04 prefix).

Enums§

SignError
Errors from signing or verifying.

Functions§

coord_len 🔒
Coordinate length (octets) of the suite’s curve, or None if the suite has no ECDSA curve.
ecdsa_sign
Signs message with an ECDSA private key (raw scalar) on the suite’s curve, returning the fixed-size r ‖ s signature (64 octets for P-256, 96 for P-384). Signing is deterministic (RFC 6979).
ecdsa_verify
Verifies an ECDSA r ‖ s signature over message with a public key (raw x ‖ y or SEC1) on the suite’s curve.
to_sec1 🔒
Normalizes a public key to SEC1 uncompressed form (0x04 ‖ x ‖ y).