Commit 2f63e765 authored by Niels Möller's avatar Niels Möller
Browse files

* src/dsa.c (SA): New define.

(encode_dsa_sig_val): Fixed type error.

Rev: src/dsa.c:1.20
parent 28fb52ba
......@@ -43,23 +43,9 @@
#include "dsa.c.x"
/* DSA signatures */
/* ;; GABA:
(class
(name dsa_signer_variant)
(super signer)
(vars
(dsa object dsa_signer)))
*/
#define SA(x) sexp_a(ATOM_##x)
/* ;; GABA:
(class
(name dsa_verifier_variant)
(super verifier)
(vars
(dsa object dsa_verifier)))
*/
/* DSA signatures */
/* GABA:
(class
......@@ -89,8 +75,8 @@ static void dsa_hash(mpz_t h, UINT32 length, const UINT8 *msg)
static struct sexp *
encode_dsa_sig_val(mpz_t r, mpz_t s)
{
return sexp_l(2, sexp_l(2, ATOM_R, sexp_un(r), -1),
sexp_l(2, ATOM_S, sexp_un(s), -1), -1);
return sexp_l(2, sexp_l(2, SA(R), sexp_un(r), -1),
sexp_l(2, SA(S), sexp_un(s), -1), -1);
}
static int
......@@ -253,12 +239,12 @@ do_dsa_sign_spki(struct signer *c,
struct sexp *
make_dsa_public_key(struct dsa_public *dsa)
{
return sexp_l(2, sexp_a(ATOM_PUBLIC_KEY),
sexp_l(5, sexp_a(ATOM_DSA),
sexp_l(2, sexp_a(ATOM_P), sexp_un(dsa->p), -1),
sexp_l(2, sexp_a(ATOM_Q), sexp_un(dsa->q), -1),
sexp_l(2, sexp_a(ATOM_G), sexp_un(dsa->g), -1),
sexp_l(2, sexp_a(ATOM_Y), sexp_un(dsa->y), -1),
return sexp_l(2, SA(PUBLIC_KEY),
sexp_l(5, SA(DSA),
sexp_l(2, SA(P), sexp_un(dsa->p), -1),
sexp_l(2, SA(Q), sexp_un(dsa->q), -1),
sexp_l(2, SA(G), sexp_un(dsa->g), -1),
sexp_l(2, SA(Y), sexp_un(dsa->y), -1),
-1), -1);
}
......
Supports Markdown
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