math/mpx-mul4-*.S: Use more portable type syntax for ambiguous instructions.
[catacomb] / pub / dsa-misc.c
index 4f68c7b..3902f68 100644 (file)
@@ -67,7 +67,7 @@ mp *dsa_h2n(mp *d, mp *r, const void *h, size_t hsz)
  *             @mp *q@ = order of the DSA group
  *             @mp *x@ = secret key
  *             @const octet *m@ = message hash
- *             @const gchash *h@ = hash class
+ *             @const gchash *ch@ = hash class
  *             @grand *r@ = random bit source, or null
  *
  * Returns:    A nonce.
@@ -84,6 +84,7 @@ mp *dsa_nonce(mp *d, mp *q, mp *x, const octet *m,
   size_t bsz = 2*n + 2*ch->hashsz;
   octet *b = XS_ALLOC(bsz);
   octet *kb = b, *rb = kb + n, *hb = rb + ch->hashsz;
+  static const char prefix[] = "catacomb-dsa-nonce";
   ghash *h;
 
   mp_storeb(x, kb, n);
@@ -92,6 +93,7 @@ mp *dsa_nonce(mp *d, mp *q, mp *x, const octet *m,
   do {
     for (j = 0; j < n; j += ch->hashsz) {
       h = GH_INIT(ch);
+      GH_HASH(h, prefix, sizeof(prefix));
       GH_HASHBUF32(h, kb, n);
       GH_HASHBUF32(h, m, ch->hashsz);
       if (r) GH_HASHBUF32(h, rb, ch->hashsz);