Skip to main content

pamoja_lorawan_mc_root_key

Function pamoja_lorawan_mc_root_key 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_lorawan_mc_root_key( root_key: *const u8, lorawan_11: u8, out_key: *mut u8, ) -> PamojaStatus
Expand description

Derives a device’s multicast root key, TS005-2.0.0 section 4.3.

§Arguments

  • root_key - the device’s sixteen-byte GenAppKey on LoRaWAN 1.0.x, or its AppKey on 1.1.
  • lorawan_11 - 1 for the 1.1 scheme, which starts from another constant.
  • out_key - receives the sixteen-byte McRootKey.

§Returns

PamojaStatus::Ok on success.

§Errors

Returns PamojaStatus::InvalidArgument for a null pointer.

§Safety

root_key must point to sixteen readable bytes and out_key to sixteen writable ones.