… | |
… | |
47 | |
47 | |
48 | void curve25519_generate (curve25519_key &a, curve25519_key &b) |
48 | void curve25519_generate (curve25519_key &a, curve25519_key &b) |
49 | { |
49 | { |
50 | rand_fill (a); |
50 | rand_fill (a); |
51 | |
51 | |
|
|
52 | #if 0 |
52 | a [ 0] &= 0xf8; |
53 | a [ 0] &= 0xf8; |
53 | a [31] &= 0x7f; |
54 | a [31] &= 0x7f; |
54 | a [31] |= 0x40; |
55 | a [31] |= 0x40; |
|
|
56 | #endif |
55 | |
57 | |
56 | curve25519_derive (a, b); |
58 | curve25519_derive (a, b); |
57 | } |
59 | } |
58 | |
60 | |
59 | void curve25519_combine (const curve25519_key &a, const curve25519_key &b, curve25519_key &s) |
61 | void curve25519_combine (const curve25519_key &a, const curve25519_key &b, curve25519_key &s) |