Subject: Power function PGP math library?

From: Kimmo Mäkeläinen <[email-masked]>
Date: Fri, 17 Jun 2005 08:55:10 +0300

Hey,

I need to verify the DSA signature in my application, and the verifier has 
to compute these parameters, which are defined in the DSS (Digital Signature 
Standard).

w = (s')^-1 mod q
u1 = ((SHA(M')w) mod q
u2 = ((r')w) mod q
v = (((g)^u1 * (y^u2) mod p) mod q

I'm using PGP math library in calculation. The problem is how to calculate 
parameter v.

The parameters g (power to u1) and y (power to u2) should be calculated 
first and then these factors should be calculated together and so on. But 
there isn't a function in the math library to calculate powers. The 
calculation could be done with mp_mult, but it is very slow way to do it.

Best regards,

Kimmo

_________________________________________________________________
Nopea ja hauska tapa lähettää viestejä reaaliaikaisesti - MSN Messenger. 
http://messenger.msn.fi

---

From: "Konrad Rosenbaum" <[email-masked]>
Date: Fri, 17 Jun 2005 09:08:21 +0200 (CEST)

> calculation could be done with mp_mult, but it is very slow way to do it.

Basic modular math:

(g^u1 * y^u2) mod p == ( ((g^u1)mod p) * ((y^u2) mod p) ) mod p

you do not really want to calculate g^u1 or y^u2 since it will be a Really
Big Number [tm].

     Konrad