Skip to main content

gost_protect

Function gost_protect 

Source
pub fn gost_protect(
    ctx: &SecurityContext,
    ciphered_tag: u8,
    plaintext: &[u8],
) -> Result<Vec<u8>, CipherError>
Expand description

GOST-authenticated encryption using Kuznyechik CTR+CMAC (Р 1323565.1).

  • Encryption: Kuznyechik in CTR mode (IV = system_title ‖ IC).
  • Authentication: Kuznyechik CMAC over SC ‖ AK ‖ ciphertext.
  • Tag: 16-byte full CMAC output.

Returns the encrypted APDU with the GOST tag appended.