Skip to main content

manufacturer_aes

Function manufacturer_aes 

Source
pub fn manufacturer_aes(secret: &[u8], challenge: &[u8]) -> Vec<u8> ⓘ
Expand description

HLS mechanism 2 (manufacturer-specific “high” authentication).

DLMS/COSEM does not specify mechanism 2, so implementations follow the widely deployed Texas-Instruments scheme: AES-128 over the zero-padded challenge, keyed by the zero-padded secret. The challenge and secret are padded to a common length that is a multiple of 16 (the larger of the two, rounded up); each 16-octet block of the padded challenge is then encrypted. As in the reference, the key is carried mutated from one block to the next, so multi-block challenges are not plain ECB.