示例#1
0
static int
check_data(const dst_private_t *priv, const unsigned int alg,
	   isc_boolean_t old, isc_boolean_t external)
{
	/* XXXVIX this switch statement is too sparse to gen a jump table. */
	switch (alg) {
	case DST_ALG_RSAMD5:
	case DST_ALG_RSASHA1:
	case DST_ALG_NSEC3RSASHA1:
	case DST_ALG_RSASHA256:
	case DST_ALG_RSASHA512:
		return (check_rsa(priv, external));
	case DST_ALG_DH:
		return (check_dh(priv));
	case DST_ALG_DSA:
	case DST_ALG_NSEC3DSA:
		return (check_dsa(priv, external));
	case DST_ALG_ECCGOST:
		return (check_gost(priv, external));
	case DST_ALG_ECDSA256:
	case DST_ALG_ECDSA384:
		return (check_ecdsa(priv, external));
	case DST_ALG_HMACMD5:
		return (check_hmac_md5(priv, old));
	case DST_ALG_HMACSHA1:
		return (check_hmac_sha(priv, HMACSHA1_NTAGS, alg));
	case DST_ALG_HMACSHA224:
		return (check_hmac_sha(priv, HMACSHA224_NTAGS, alg));
	case DST_ALG_HMACSHA256:
		return (check_hmac_sha(priv, HMACSHA256_NTAGS, alg));
	case DST_ALG_HMACSHA384:
		return (check_hmac_sha(priv, HMACSHA384_NTAGS, alg));
	case DST_ALG_HMACSHA512:
		return (check_hmac_sha(priv, HMACSHA512_NTAGS, alg));
	default:
		return (DST_R_UNSUPPORTEDALG);
	}
}
示例#2
0
文件: ec.c 项目: lyvius/ps3tools
int ecdsa_verify(u8 *hash, u8 *R, u8 *S)
{
	return check_ecdsa(&ec_Q, R, S, hash);
}