def test_zigbee_security_hash(): message = bytes( [0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x4A, 0xF7]) key = util.aes_mmo_hash(message) assert key == [ 0x41, 0x61, 0x8F, 0xC0, 0xC8, 0x3B, 0x0E, 0x14, 0xA5, 0x89, 0x95, 0x4B, 0x16, 0xE3, 0x14, 0x66 ] message = bytes([ 0x7A, 0x93, 0x97, 0x23, 0xA5, 0xC6, 0x39, 0xB2, 0x69, 0x16, 0x18, 0x02, 0x81, 0x9B ]) key = util.aes_mmo_hash(message) assert key == [ 0xF9, 0x39, 0x03, 0x72, 0x16, 0x85, 0xFD, 0x32, 0x9D, 0x26, 0x84, 0x9B, 0x90, 0xF2, 0x95, 0x9A ] message = bytes([ 0x83, 0xFE, 0xD3, 0x40, 0x7A, 0x93, 0x97, 0x23, 0xA5, 0xC6, 0x39, 0xB2, 0x69, 0x16, 0x18, 0x02, 0xAE, 0xBB ]) key = util.aes_mmo_hash(message) assert key == [ 0x33, 0x3C, 0x23, 0x68, 0x60, 0x79, 0x46, 0x8E, 0xB2, 0x7B, 0xA2, 0x4B, 0xD9, 0xC7, 0xE5, 0x64 ]
def test_zigbee_security_hash(): message = bytes.fromhex("11223344556677884AF7") key = util.aes_mmo_hash(message) assert key == KeyData.convert("41618FC0C83B0E14A589954B16E31466") message = bytes.fromhex("7A939723A5C639B269161802819B") key = util.aes_mmo_hash(message) assert key == KeyData.convert("F93903721685FD329D26849B90F2959A") message = bytes.fromhex("83FED3407A939723A5C639B269161802AEBB") key = util.aes_mmo_hash(message) assert key == KeyData.convert("333C23686079468EB27BA24BD9C7E564")