Skip to main content

Module crypto

Module crypto 

Source
Expand description

Thin wrappers over the RustCrypto primitives in the shapes Z-Wave uses.

Every function here is a direct call into a maintained crate: AES-128 (aes), AES-CMAC (cmac), AES-CCM with an 8-byte tag and a 13-byte nonce (ccm), AES-OFB (ofb) and AES-CBC-MAC (cbc-mac).

Constants§

CCM_NONCE_LEN
Length of the S2 CCM nonce.
CCM_TAG_LEN
Length of the CCM authentication tag S2 appends.

Functions§

aes128_ecb
Encrypts one 16-byte block with AES-128 (ECB).
aes128_ofb
AES-128-OFB keystream applied to data (encrypts and decrypts).
cbc_mac
AES-128-CBC-MAC with a zero IV and zero padding: the full last block.
ccm_decrypt
AES-128-CCM decryption of ciphertext-with-tag; None when authentication fails.
ccm_encrypt
AES-128-CCM encryption: returns ciphertext followed by the 8-byte tag.
cmac
AES-128-CMAC (NIST SP 800-38B) of msg under key.