Skip to main content

pamoja_lorawan_block_mic_start

Function pamoja_lorawan_block_mic_start 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_lorawan_block_mic_start( data_block_int_key: *const u8, session_cnt: u16, frag_index: u8, descriptor: *const u8, block_len: u32, out_mic: *mut *mut PamojaLorawanBlockMic, ) -> PamojaStatus
Expand description

Starts a code over one session’s block, TS004-2.0.0 section 3.3.

§Arguments

  • data_block_int_key - the sixteen-byte key pamoja_lorawan_data_block_int_key derived.
  • session_cnt - the session counter the setup carried.
  • frag_index - which of the device’s sessions this is.
  • descriptor - the four bytes the setup described the block with.
  • block_len - the block’s length without its padding.
  • out_mic - receives the code.

§Returns

PamojaStatus::Ok on success, with *out_mic set to a handle the caller must release with pamoja_lorawan_block_mic_free.

§Errors

Returns PamojaStatus::InvalidArgument for a null pointer.

§Safety

data_block_int_key must point to sixteen readable bytes, descriptor to four, and out_mic must be writable.