crypto: ecdsa - Migrate to sig_alg backend

A sig_alg backend has just been introduced with the intent of moving all
asymmetric sign/verify algorithms to it one by one.

Migrate ecdsa.c to the new backend.

One benefit of the new API is the use of kernel buffers instead of
sglists, which avoids the overhead of copying signature and digest
sglists back into kernel buffers.  ecdsa.c is thus simplified quite
a bit.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Lukas Wunner 2024-09-10 16:30:13 +02:00 committed by Herbert Xu
parent 65c4c93caa
commit ef132350a3
4 changed files with 55 additions and 90 deletions

View File

@ -290,7 +290,7 @@ config CRYPTO_ECDH
config CRYPTO_ECDSA config CRYPTO_ECDSA
tristate "ECDSA (Elliptic Curve Digital Signature Algorithm)" tristate "ECDSA (Elliptic Curve Digital Signature Algorithm)"
select CRYPTO_ECC select CRYPTO_ECC
select CRYPTO_AKCIPHER select CRYPTO_SIG
select ASN1 select ASN1
help help
ECDSA (Elliptic Curve Digital Signature Algorithm) (FIPS 186, ECDSA (Elliptic Curve Digital Signature Algorithm) (FIPS 186,

View File

@ -4,12 +4,11 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <crypto/internal/akcipher.h>
#include <crypto/internal/ecc.h> #include <crypto/internal/ecc.h>
#include <crypto/akcipher.h> #include <crypto/internal/sig.h>
#include <crypto/ecdh.h> #include <crypto/ecdh.h>
#include <crypto/sig.h>
#include <linux/asn1_decoder.h> #include <linux/asn1_decoder.h>
#include <linux/scatterlist.h>
#include "ecdsasignature.asn1.h" #include "ecdsasignature.asn1.h"
@ -126,46 +125,31 @@ static int _ecdsa_verify(struct ecc_ctx *ctx, const u64 *hash, const u64 *r, con
/* /*
* Verify an ECDSA signature. * Verify an ECDSA signature.
*/ */
static int ecdsa_verify(struct akcipher_request *req) static int ecdsa_verify(struct crypto_sig *tfm,
const void *src, unsigned int slen,
const void *digest, unsigned int dlen)
{ {
struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); struct ecc_ctx *ctx = crypto_sig_ctx(tfm);
struct ecc_ctx *ctx = akcipher_tfm_ctx(tfm);
size_t bufsize = ctx->curve->g.ndigits * sizeof(u64); size_t bufsize = ctx->curve->g.ndigits * sizeof(u64);
struct ecdsa_signature_ctx sig_ctx = { struct ecdsa_signature_ctx sig_ctx = {
.curve = ctx->curve, .curve = ctx->curve,
}; };
u64 hash[ECC_MAX_DIGITS]; u64 hash[ECC_MAX_DIGITS];
unsigned char *buffer;
int ret; int ret;
if (unlikely(!ctx->pub_key_set)) if (unlikely(!ctx->pub_key_set))
return -EINVAL; return -EINVAL;
buffer = kmalloc(req->src_len + req->dst_len, GFP_KERNEL); ret = asn1_ber_decoder(&ecdsasignature_decoder, &sig_ctx, src, slen);
if (!buffer)
return -ENOMEM;
sg_pcopy_to_buffer(req->src,
sg_nents_for_len(req->src, req->src_len + req->dst_len),
buffer, req->src_len + req->dst_len, 0);
ret = asn1_ber_decoder(&ecdsasignature_decoder, &sig_ctx,
buffer, req->src_len);
if (ret < 0) if (ret < 0)
goto error; return ret;
if (bufsize > req->dst_len) if (bufsize > dlen)
bufsize = req->dst_len; bufsize = dlen;
ecc_digits_from_bytes(buffer + req->src_len, bufsize, ecc_digits_from_bytes(digest, bufsize, hash, ctx->curve->g.ndigits);
hash, ctx->curve->g.ndigits);
ret = _ecdsa_verify(ctx, hash, sig_ctx.r, sig_ctx.s); return _ecdsa_verify(ctx, hash, sig_ctx.r, sig_ctx.s);
error:
kfree(buffer);
return ret;
} }
static int ecdsa_ecc_ctx_init(struct ecc_ctx *ctx, unsigned int curve_id) static int ecdsa_ecc_ctx_init(struct ecc_ctx *ctx, unsigned int curve_id)
@ -201,9 +185,10 @@ static int ecdsa_ecc_ctx_reset(struct ecc_ctx *ctx)
* Set the public ECC key as defined by RFC5480 section 2.2 "Subject Public * Set the public ECC key as defined by RFC5480 section 2.2 "Subject Public
* Key". Only the uncompressed format is supported. * Key". Only the uncompressed format is supported.
*/ */
static int ecdsa_set_pub_key(struct crypto_akcipher *tfm, const void *key, unsigned int keylen) static int ecdsa_set_pub_key(struct crypto_sig *tfm, const void *key,
unsigned int keylen)
{ {
struct ecc_ctx *ctx = akcipher_tfm_ctx(tfm); struct ecc_ctx *ctx = crypto_sig_ctx(tfm);
unsigned int digitlen, ndigits; unsigned int digitlen, ndigits;
const unsigned char *d = key; const unsigned char *d = key;
int ret; int ret;
@ -237,28 +222,28 @@ static int ecdsa_set_pub_key(struct crypto_akcipher *tfm, const void *key, unsig
return ret; return ret;
} }
static void ecdsa_exit_tfm(struct crypto_akcipher *tfm) static void ecdsa_exit_tfm(struct crypto_sig *tfm)
{ {
struct ecc_ctx *ctx = akcipher_tfm_ctx(tfm); struct ecc_ctx *ctx = crypto_sig_ctx(tfm);
ecdsa_ecc_ctx_deinit(ctx); ecdsa_ecc_ctx_deinit(ctx);
} }
static unsigned int ecdsa_max_size(struct crypto_akcipher *tfm) static unsigned int ecdsa_max_size(struct crypto_sig *tfm)
{ {
struct ecc_ctx *ctx = akcipher_tfm_ctx(tfm); struct ecc_ctx *ctx = crypto_sig_ctx(tfm);
return DIV_ROUND_UP(ctx->curve->nbits, 8); return DIV_ROUND_UP(ctx->curve->nbits, 8);
} }
static int ecdsa_nist_p521_init_tfm(struct crypto_akcipher *tfm) static int ecdsa_nist_p521_init_tfm(struct crypto_sig *tfm)
{ {
struct ecc_ctx *ctx = akcipher_tfm_ctx(tfm); struct ecc_ctx *ctx = crypto_sig_ctx(tfm);
return ecdsa_ecc_ctx_init(ctx, ECC_CURVE_NIST_P521); return ecdsa_ecc_ctx_init(ctx, ECC_CURVE_NIST_P521);
} }
static struct akcipher_alg ecdsa_nist_p521 = { static struct sig_alg ecdsa_nist_p521 = {
.verify = ecdsa_verify, .verify = ecdsa_verify,
.set_pub_key = ecdsa_set_pub_key, .set_pub_key = ecdsa_set_pub_key,
.max_size = ecdsa_max_size, .max_size = ecdsa_max_size,
@ -273,14 +258,14 @@ static struct akcipher_alg ecdsa_nist_p521 = {
}, },
}; };
static int ecdsa_nist_p384_init_tfm(struct crypto_akcipher *tfm) static int ecdsa_nist_p384_init_tfm(struct crypto_sig *tfm)
{ {
struct ecc_ctx *ctx = akcipher_tfm_ctx(tfm); struct ecc_ctx *ctx = crypto_sig_ctx(tfm);
return ecdsa_ecc_ctx_init(ctx, ECC_CURVE_NIST_P384); return ecdsa_ecc_ctx_init(ctx, ECC_CURVE_NIST_P384);
} }
static struct akcipher_alg ecdsa_nist_p384 = { static struct sig_alg ecdsa_nist_p384 = {
.verify = ecdsa_verify, .verify = ecdsa_verify,
.set_pub_key = ecdsa_set_pub_key, .set_pub_key = ecdsa_set_pub_key,
.max_size = ecdsa_max_size, .max_size = ecdsa_max_size,
@ -295,14 +280,14 @@ static struct akcipher_alg ecdsa_nist_p384 = {
}, },
}; };
static int ecdsa_nist_p256_init_tfm(struct crypto_akcipher *tfm) static int ecdsa_nist_p256_init_tfm(struct crypto_sig *tfm)
{ {
struct ecc_ctx *ctx = akcipher_tfm_ctx(tfm); struct ecc_ctx *ctx = crypto_sig_ctx(tfm);
return ecdsa_ecc_ctx_init(ctx, ECC_CURVE_NIST_P256); return ecdsa_ecc_ctx_init(ctx, ECC_CURVE_NIST_P256);
} }
static struct akcipher_alg ecdsa_nist_p256 = { static struct sig_alg ecdsa_nist_p256 = {
.verify = ecdsa_verify, .verify = ecdsa_verify,
.set_pub_key = ecdsa_set_pub_key, .set_pub_key = ecdsa_set_pub_key,
.max_size = ecdsa_max_size, .max_size = ecdsa_max_size,
@ -317,14 +302,14 @@ static struct akcipher_alg ecdsa_nist_p256 = {
}, },
}; };
static int ecdsa_nist_p192_init_tfm(struct crypto_akcipher *tfm) static int ecdsa_nist_p192_init_tfm(struct crypto_sig *tfm)
{ {
struct ecc_ctx *ctx = akcipher_tfm_ctx(tfm); struct ecc_ctx *ctx = crypto_sig_ctx(tfm);
return ecdsa_ecc_ctx_init(ctx, ECC_CURVE_NIST_P192); return ecdsa_ecc_ctx_init(ctx, ECC_CURVE_NIST_P192);
} }
static struct akcipher_alg ecdsa_nist_p192 = { static struct sig_alg ecdsa_nist_p192 = {
.verify = ecdsa_verify, .verify = ecdsa_verify,
.set_pub_key = ecdsa_set_pub_key, .set_pub_key = ecdsa_set_pub_key,
.max_size = ecdsa_max_size, .max_size = ecdsa_max_size,
@ -345,42 +330,42 @@ static int __init ecdsa_init(void)
int ret; int ret;
/* NIST p192 may not be available in FIPS mode */ /* NIST p192 may not be available in FIPS mode */
ret = crypto_register_akcipher(&ecdsa_nist_p192); ret = crypto_register_sig(&ecdsa_nist_p192);
ecdsa_nist_p192_registered = ret == 0; ecdsa_nist_p192_registered = ret == 0;
ret = crypto_register_akcipher(&ecdsa_nist_p256); ret = crypto_register_sig(&ecdsa_nist_p256);
if (ret) if (ret)
goto nist_p256_error; goto nist_p256_error;
ret = crypto_register_akcipher(&ecdsa_nist_p384); ret = crypto_register_sig(&ecdsa_nist_p384);
if (ret) if (ret)
goto nist_p384_error; goto nist_p384_error;
ret = crypto_register_akcipher(&ecdsa_nist_p521); ret = crypto_register_sig(&ecdsa_nist_p521);
if (ret) if (ret)
goto nist_p521_error; goto nist_p521_error;
return 0; return 0;
nist_p521_error: nist_p521_error:
crypto_unregister_akcipher(&ecdsa_nist_p384); crypto_unregister_sig(&ecdsa_nist_p384);
nist_p384_error: nist_p384_error:
crypto_unregister_akcipher(&ecdsa_nist_p256); crypto_unregister_sig(&ecdsa_nist_p256);
nist_p256_error: nist_p256_error:
if (ecdsa_nist_p192_registered) if (ecdsa_nist_p192_registered)
crypto_unregister_akcipher(&ecdsa_nist_p192); crypto_unregister_sig(&ecdsa_nist_p192);
return ret; return ret;
} }
static void __exit ecdsa_exit(void) static void __exit ecdsa_exit(void)
{ {
if (ecdsa_nist_p192_registered) if (ecdsa_nist_p192_registered)
crypto_unregister_akcipher(&ecdsa_nist_p192); crypto_unregister_sig(&ecdsa_nist_p192);
crypto_unregister_akcipher(&ecdsa_nist_p256); crypto_unregister_sig(&ecdsa_nist_p256);
crypto_unregister_akcipher(&ecdsa_nist_p384); crypto_unregister_sig(&ecdsa_nist_p384);
crypto_unregister_akcipher(&ecdsa_nist_p521); crypto_unregister_sig(&ecdsa_nist_p521);
} }
subsys_initcall(ecdsa_init); subsys_initcall(ecdsa_init);

View File

@ -4432,7 +4432,6 @@ static int test_sig(struct crypto_sig *tfm, const char *alg,
return 0; return 0;
} }
__maybe_unused
static int alg_test_sig(const struct alg_test_desc *desc, const char *driver, static int alg_test_sig(const struct alg_test_desc *desc, const char *driver,
u32 type, u32 mask) u32 type, u32 mask)
{ {
@ -5242,30 +5241,30 @@ static const struct alg_test_desc alg_test_descs[] = {
} }
}, { }, {
.alg = "ecdsa-nist-p192", .alg = "ecdsa-nist-p192",
.test = alg_test_akcipher, .test = alg_test_sig,
.suite = { .suite = {
.akcipher = __VECS(ecdsa_nist_p192_tv_template) .sig = __VECS(ecdsa_nist_p192_tv_template)
} }
}, { }, {
.alg = "ecdsa-nist-p256", .alg = "ecdsa-nist-p256",
.test = alg_test_akcipher, .test = alg_test_sig,
.fips_allowed = 1, .fips_allowed = 1,
.suite = { .suite = {
.akcipher = __VECS(ecdsa_nist_p256_tv_template) .sig = __VECS(ecdsa_nist_p256_tv_template)
} }
}, { }, {
.alg = "ecdsa-nist-p384", .alg = "ecdsa-nist-p384",
.test = alg_test_akcipher, .test = alg_test_sig,
.fips_allowed = 1, .fips_allowed = 1,
.suite = { .suite = {
.akcipher = __VECS(ecdsa_nist_p384_tv_template) .sig = __VECS(ecdsa_nist_p384_tv_template)
} }
}, { }, {
.alg = "ecdsa-nist-p521", .alg = "ecdsa-nist-p521",
.test = alg_test_akcipher, .test = alg_test_sig,
.fips_allowed = 1, .fips_allowed = 1,
.suite = { .suite = {
.akcipher = __VECS(ecdsa_nist_p521_tv_template) .sig = __VECS(ecdsa_nist_p521_tv_template)
} }
}, { }, {
.alg = "ecrdsa", .alg = "ecrdsa",

View File

@ -663,7 +663,7 @@ static const struct akcipher_testvec rsa_tv_template[] = {
/* /*
* ECDSA test vectors. * ECDSA test vectors.
*/ */
static const struct akcipher_testvec ecdsa_nist_p192_tv_template[] = { static const struct sig_testvec ecdsa_nist_p192_tv_template[] = {
{ {
.key = /* secp192r1(sha1) */ .key = /* secp192r1(sha1) */
"\x04\xf7\x46\xf8\x2f\x15\xf6\x22\x8e\xd7\x57\x4f\xcc\xe7\xbb\xc1" "\x04\xf7\x46\xf8\x2f\x15\xf6\x22\x8e\xd7\x57\x4f\xcc\xe7\xbb\xc1"
@ -682,7 +682,6 @@ static const struct akcipher_testvec ecdsa_nist_p192_tv_template[] = {
"\x80\x6f\xa5\x79\x77\xda\xd0", "\x80\x6f\xa5\x79\x77\xda\xd0",
.c_size = 55, .c_size = 55,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, { }, {
.key = /* secp192r1(sha224) */ .key = /* secp192r1(sha224) */
"\x04\xb6\x4b\xb1\xd1\xac\xba\x24\x8f\x65\xb2\x60\x00\x90\xbf\xbd" "\x04\xb6\x4b\xb1\xd1\xac\xba\x24\x8f\x65\xb2\x60\x00\x90\xbf\xbd"
@ -701,7 +700,6 @@ static const struct akcipher_testvec ecdsa_nist_p192_tv_template[] = {
"\x5c\x99\xdb\x92\x5b\x36", "\x5c\x99\xdb\x92\x5b\x36",
.c_size = 54, .c_size = 54,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, { }, {
.key = /* secp192r1(sha256) */ .key = /* secp192r1(sha256) */
"\x04\xe2\x51\x24\x9b\xf7\xb6\x32\x82\x39\x66\x3d\x5b\xec\x3b\xae" "\x04\xe2\x51\x24\x9b\xf7\xb6\x32\x82\x39\x66\x3d\x5b\xec\x3b\xae"
@ -720,7 +718,6 @@ static const struct akcipher_testvec ecdsa_nist_p192_tv_template[] = {
"\x3a\x97\xd9\xcd\x1a\x6a\x49", "\x3a\x97\xd9\xcd\x1a\x6a\x49",
.c_size = 55, .c_size = 55,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, { }, {
.key = /* secp192r1(sha384) */ .key = /* secp192r1(sha384) */
"\x04\x5a\x13\xfe\x68\x86\x4d\xf4\x17\xc7\xa4\xe5\x8c\x65\x57\xb7" "\x04\x5a\x13\xfe\x68\x86\x4d\xf4\x17\xc7\xa4\xe5\x8c\x65\x57\xb7"
@ -740,7 +737,6 @@ static const struct akcipher_testvec ecdsa_nist_p192_tv_template[] = {
"\x12\x3b\x3b\x28\xfb\x6d\xe1", "\x12\x3b\x3b\x28\xfb\x6d\xe1",
.c_size = 55, .c_size = 55,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, { }, {
.key = /* secp192r1(sha512) */ .key = /* secp192r1(sha512) */
"\x04\xd5\xf2\x6e\xc3\x94\x5c\x52\xbc\xdf\x86\x6c\x14\xd1\xca\xea" "\x04\xd5\xf2\x6e\xc3\x94\x5c\x52\xbc\xdf\x86\x6c\x14\xd1\xca\xea"
@ -761,11 +757,10 @@ static const struct akcipher_testvec ecdsa_nist_p192_tv_template[] = {
"\x6a\xdf\x97\xfd\x82\x76\x24", "\x6a\xdf\x97\xfd\x82\x76\x24",
.c_size = 55, .c_size = 55,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, },
}; };
static const struct akcipher_testvec ecdsa_nist_p256_tv_template[] = { static const struct sig_testvec ecdsa_nist_p256_tv_template[] = {
{ {
.key = /* secp256r1(sha1) */ .key = /* secp256r1(sha1) */
"\x04\xb9\x7b\xbb\xd7\x17\x64\xd2\x7e\xfc\x81\x5d\x87\x06\x83\x41" "\x04\xb9\x7b\xbb\xd7\x17\x64\xd2\x7e\xfc\x81\x5d\x87\x06\x83\x41"
@ -786,7 +781,6 @@ static const struct akcipher_testvec ecdsa_nist_p256_tv_template[] = {
"\xfb\x9d\x8b\xde\xd4\x8d\x6f\xad", "\xfb\x9d\x8b\xde\xd4\x8d\x6f\xad",
.c_size = 72, .c_size = 72,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, { }, {
.key = /* secp256r1(sha224) */ .key = /* secp256r1(sha224) */
"\x04\x8b\x6d\xc0\x33\x8e\x2d\x8b\x67\xf5\xeb\xc4\x7f\xa0\xf5\xd9" "\x04\x8b\x6d\xc0\x33\x8e\x2d\x8b\x67\xf5\xeb\xc4\x7f\xa0\xf5\xd9"
@ -807,7 +801,6 @@ static const struct akcipher_testvec ecdsa_nist_p256_tv_template[] = {
"\x2e\x8b\xde\x5a\x04\x0e", "\x2e\x8b\xde\x5a\x04\x0e",
.c_size = 70, .c_size = 70,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, { }, {
.key = /* secp256r1(sha256) */ .key = /* secp256r1(sha256) */
"\x04\xf1\xea\xc4\x53\xf3\xb9\x0e\x9f\x7e\xad\xe3\xea\xd7\x0e\x0f" "\x04\xf1\xea\xc4\x53\xf3\xb9\x0e\x9f\x7e\xad\xe3\xea\xd7\x0e\x0f"
@ -828,7 +821,6 @@ static const struct akcipher_testvec ecdsa_nist_p256_tv_template[] = {
"\x2a\x65\x35\x23\xe3\x1d\xfa", "\x2a\x65\x35\x23\xe3\x1d\xfa",
.c_size = 71, .c_size = 71,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, { }, {
.key = /* secp256r1(sha384) */ .key = /* secp256r1(sha384) */
"\x04\xc5\xc6\xea\x60\xc9\xce\xad\x02\x8d\xf5\x3e\x24\xe3\x52\x1d" "\x04\xc5\xc6\xea\x60\xc9\xce\xad\x02\x8d\xf5\x3e\x24\xe3\x52\x1d"
@ -850,7 +842,6 @@ static const struct akcipher_testvec ecdsa_nist_p256_tv_template[] = {
"\xc0\x60\x11\x92\xdc\x17\x89\x12", "\xc0\x60\x11\x92\xdc\x17\x89\x12",
.c_size = 72, .c_size = 72,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, { }, {
.key = /* secp256r1(sha512) */ .key = /* secp256r1(sha512) */
"\x04\xd7\x27\x46\x49\xf6\x26\x85\x12\x40\x76\x8e\xe2\xe6\x2a\x7a" "\x04\xd7\x27\x46\x49\xf6\x26\x85\x12\x40\x76\x8e\xe2\xe6\x2a\x7a"
@ -873,11 +864,10 @@ static const struct akcipher_testvec ecdsa_nist_p256_tv_template[] = {
"\x31\x79\x4a\xe9\x81\x6a\xee", "\x31\x79\x4a\xe9\x81\x6a\xee",
.c_size = 71, .c_size = 71,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, },
}; };
static const struct akcipher_testvec ecdsa_nist_p384_tv_template[] = { static const struct sig_testvec ecdsa_nist_p384_tv_template[] = {
{ {
.key = /* secp384r1(sha1) */ .key = /* secp384r1(sha1) */
"\x04\x89\x25\xf3\x97\x88\xcb\xb0\x78\xc5\x72\x9a\x14\x6e\x7a\xb1" "\x04\x89\x25\xf3\x97\x88\xcb\xb0\x78\xc5\x72\x9a\x14\x6e\x7a\xb1"
@ -902,7 +892,6 @@ static const struct akcipher_testvec ecdsa_nist_p384_tv_template[] = {
"\x79\x12\x2a\xb7\xc5\x15\x92\xc5", "\x79\x12\x2a\xb7\xc5\x15\x92\xc5",
.c_size = 104, .c_size = 104,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, { }, {
.key = /* secp384r1(sha224) */ .key = /* secp384r1(sha224) */
"\x04\x69\x6c\xcf\x62\xee\xd0\x0d\xe5\xb5\x2f\x70\x54\xcf\x26\xa0" "\x04\x69\x6c\xcf\x62\xee\xd0\x0d\xe5\xb5\x2f\x70\x54\xcf\x26\xa0"
@ -927,7 +916,6 @@ static const struct akcipher_testvec ecdsa_nist_p384_tv_template[] = {
"\x88\x2b\x82\x26\x5e\x1c\xda\xfb", "\x88\x2b\x82\x26\x5e\x1c\xda\xfb",
.c_size = 104, .c_size = 104,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, { }, {
.key = /* secp384r1(sha256) */ .key = /* secp384r1(sha256) */
"\x04\xee\xd6\xda\x3e\x94\x90\x00\x27\xed\xf8\x64\x55\xd6\x51\x9a" "\x04\xee\xd6\xda\x3e\x94\x90\x00\x27\xed\xf8\x64\x55\xd6\x51\x9a"
@ -952,7 +940,6 @@ static const struct akcipher_testvec ecdsa_nist_p384_tv_template[] = {
"\xf4\x1f\x39\xca\x4d\x43", "\xf4\x1f\x39\xca\x4d\x43",
.c_size = 102, .c_size = 102,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, { }, {
.key = /* secp384r1(sha384) */ .key = /* secp384r1(sha384) */
"\x04\x3a\x2f\x62\xe7\x1a\xcf\x24\xd0\x0b\x7c\xe0\xed\x46\x0a\x4f" "\x04\x3a\x2f\x62\xe7\x1a\xcf\x24\xd0\x0b\x7c\xe0\xed\x46\x0a\x4f"
@ -978,7 +965,6 @@ static const struct akcipher_testvec ecdsa_nist_p384_tv_template[] = {
"\xab\x8d\x4e\xde\xe6\x6d\x9b\x66", "\xab\x8d\x4e\xde\xe6\x6d\x9b\x66",
.c_size = 104, .c_size = 104,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, { }, {
.key = /* secp384r1(sha512) */ .key = /* secp384r1(sha512) */
"\x04\xb4\xe7\xc1\xeb\x64\x25\x22\x46\xc3\x86\x61\x80\xbe\x1e\x46" "\x04\xb4\xe7\xc1\xeb\x64\x25\x22\x46\xc3\x86\x61\x80\xbe\x1e\x46"
@ -1005,11 +991,10 @@ static const struct akcipher_testvec ecdsa_nist_p384_tv_template[] = {
"\x3c\x93\xff\x50\x5d", "\x3c\x93\xff\x50\x5d",
.c_size = 101, .c_size = 101,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, },
}; };
static const struct akcipher_testvec ecdsa_nist_p521_tv_template[] = { static const struct sig_testvec ecdsa_nist_p521_tv_template[] = {
{ {
.key = /* secp521r1(sha224) */ .key = /* secp521r1(sha224) */
"\x04\x01\x4f\x43\x18\xb6\xa9\xc9\x5d\x68\xd3\xa9\x42\xf8\x98\xc0" "\x04\x01\x4f\x43\x18\xb6\xa9\xc9\x5d\x68\xd3\xa9\x42\xf8\x98\xc0"
@ -1038,7 +1023,6 @@ static const struct akcipher_testvec ecdsa_nist_p521_tv_template[] = {
"\xa3\x50\xb1\xa5\x98\x92\x2a\xa5\x52", "\xa3\x50\xb1\xa5\x98\x92\x2a\xa5\x52",
.c_size = 137, .c_size = 137,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, },
{ {
.key = /* secp521r1(sha256) */ .key = /* secp521r1(sha256) */
@ -1068,7 +1052,6 @@ static const struct akcipher_testvec ecdsa_nist_p521_tv_template[] = {
"\xb7\x1d\x91\x55\x38\xb6\xf6\x34\x65\xc7\xbd", "\xb7\x1d\x91\x55\x38\xb6\xf6\x34\x65\xc7\xbd",
.c_size = 139, .c_size = 139,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, },
{ {
.key = /* secp521r1(sha384) */ .key = /* secp521r1(sha384) */
@ -1099,7 +1082,6 @@ static const struct akcipher_testvec ecdsa_nist_p521_tv_template[] = {
"\x8f\xb4\x22\xc6\x4f\xab\x2b\x62\xc1\x42\xb1", "\x8f\xb4\x22\xc6\x4f\xab\x2b\x62\xc1\x42\xb1",
.c_size = 139, .c_size = 139,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, },
{ {
.key = /* secp521r1(sha512) */ .key = /* secp521r1(sha512) */
@ -1131,7 +1113,6 @@ static const struct akcipher_testvec ecdsa_nist_p521_tv_template[] = {
"\xa6\xe5\x25\x46\x1e\x77\x44\x78\xe0\xd1\x04", "\xa6\xe5\x25\x46\x1e\x77\x44\x78\xe0\xd1\x04",
.c_size = 139, .c_size = 139,
.public_key_vec = true, .public_key_vec = true,
.siggen_sigver_test = true,
}, },
}; };