/* @msg: Padded message @pad_len: Number of expected padding bytes @algo: Checksum algo structure having information on DER encoding etc.  */
static int rsa_verify_padding(const uint8_t *msg, const int pad_len, struct checksum_algo *algo)
/* @msg: Padded message @pad_len: Number of expected padding bytes @algo: Checksum algo structure having information on DER encoding etc.  */
static int rsa_verify_padding(const uint8_t *msg, const int pad_len, struct checksum_algo *algo)
{
	int ff_len;
	int ret;
	ret = *msg++;
	ret |= *msg++ ^ 0x01;
	ff_len = pad_len - algo->der_len - 3;
	ret |= *msg ^ 0xff;
	ret |= memcmp(msg, msg+1, ff_len-1);
	msg += ff_len;
	ret |= *msg++;
	ret |= memcmp(msg, algo->der_prefix, algo->der_len);
	return ret;
}