Function bearssl::br_gcm_check_tag [] [src]

pub unsafe extern "C" fn br_gcm_check_tag(
    ctx: *mut br_gcm_context,
    tag: *const c_void
) -> u32

\brief Compute and check GCM authentication tag.

This function is an alternative to br_gcm_get_tag(), normally used on the receiving end (i.e. when decrypting value). The tag value is recomputed and compared with the provided tag value. If they match, 1 is returned; on mismatch, 0 is returned. A returned value of 0 means that the data or the tag was altered in transit, normally leading to wholesale rejection of the complete message.

\param ctx GCM context structure. \param tag tag value to compare with (16 bytes). \return 1 on success (exact match of tag value), 0 otherwise.