Skip to main content

pamoja_update_block_split

Function pamoja_update_block_split 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_update_block_split( block: *const u8, block_len: usize, out_envelope_at: *mut usize, out_envelope_len: *mut usize, out_image_at: *mut usize, out_image_len: *mut usize, ) -> PamojaStatus
Expand description

Reads a block back into the signed manifest and the image.

§Arguments

  • block - the block as it arrived.
  • block_len - how many bytes it holds.
  • out_envelope_at - receives where the signed manifest starts inside the block.
  • out_envelope_len - receives how long it is.
  • out_image_at - receives where the image starts.
  • out_image_len - receives how long it is.

§Returns

PamojaStatus::Ok on success. The two spans point into block itself, so nothing is copied and the caller keeps it alive.

§Errors

Returns PamojaStatus::InvalidArgument for a null pointer, and PamojaStatus::Codec when the block does not carry this convention’s header.

§Safety

block must be readable for block_len bytes and every non-null out pointer writable.