Generate public value
| 62 | |
| 63 | // Generate public value |
| 64 | void DH::GeneratePublic(const byte* priv, byte* pub) |
| 65 | { |
| 66 | const word32 bc(p_.ByteCount()); |
| 67 | Integer x(priv, bc); |
| 68 | Integer y(a_exp_b_mod_c(g_, x, p_)); |
| 69 | y.Encode(pub, bc); |
| 70 | } |
| 71 | |
| 72 | |
| 73 | // Generate Agreement |