Skip to main content

vko

Function vko 

Source
pub fn vko(d: &[u8], q_pub: &[u8], ukm: &[u8]) -> Result<[u8; 32], GostError>
Expand description

VKO_GOST3410_2012_256 key-agreement function (R 50.1.113-2016 / RFC 7836).

Computes the shared key-encryption key from our private key d (little-endian Vec256), the peer public key q_pub (π_x(Q) ‖ π_y(Q), 64 octets) and the user keying material ukm (little-endian). The curve has cofactor 1, so the agreed point is S = (ukm · d mod q) · Q; the key is Streebog256(π_x(S) ‖ π_y(S)).