Commit 42721f77 authored by Niels Möller's avatar Niels Möller

(dsa_signature_from_sexp): New function.

Rev: src/nettle/dsa.h:1.6
Rev: src/nettle/sexp2dsa.c:1.3
parent d41a05cb
......@@ -153,6 +153,10 @@ dsa_generate_keypair(struct dsa_public_key *pub,
struct sexp_iterator;
int
dsa_signature_from_sexp(struct dsa_signature *rs,
struct sexp_iterator *i);
int
dsa_keypair_from_sexp_alist(struct dsa_public_key *pub,
struct dsa_private_key *priv,
......
......@@ -87,4 +87,20 @@ dsa_keypair_from_sexp(struct dsa_public_key *pub,
&& dsa_keypair_from_sexp_alist(pub, priv, limit, &i);
}
int
dsa_signature_from_sexp(struct dsa_signature *rs,
struct sexp_iterator *i)
{
static const uint8_t *names[2] = { "r", "s" };
struct sexp_iterator values[2];
if (!sexp_iterator_assoc(i, 2, names, values))
return 0;
GET(rs->r, 160, &values[0]);
GET(rs->s, 160, &values[1]);
return 1;
}
#endif /* WITH_PUBLIC_KEY */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment