Skip to main content

pamoja_image_digest

Function pamoja_image_digest 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_image_digest( image: *const u8, image_len: usize, out_digest: *mut u8, ) -> PamojaStatus
Expand description

Creates a verifier that hashes an image against what a manifest declares.

§Arguments

  • manifest - the manifest describing the image.

§Returns

A handle the caller must settle with pamoja_image_verifier_finish or abandon with pamoja_image_verifier_free, or null if the manifest carries Hashes a complete image, for a publisher filling in a manifest.

§Returns

PamojaStatus::Ok on success, with the 32-byte SHA-256 written to out_digest.

§Safety

image must point to at least image_len readable bytes, or be null when image_len is 0, and out_digest must point to at least 32 writable bytes.