use sha2::Digest;

pub fn compute_state_hash(payload_der: &[u8]) -> Vec<u8> {
    sha2::Sha256::digest(payload_der).to_vec()
}

pub fn verify_state_hash(expected: &[u8], payload_der: &[u8]) -> bool {
    compute_state_hash(payload_der).as_slice() == expected
}
