| 1 | #include <string.h> |
|---|---|
| 2 | #include "crypto_sign.h" |
| 3 | #include "crypto_hash_sha512.h" |
| 4 | #include "ge.h" |
| 5 | |
| 6 | int crypto_sign_keypair( |
| 7 | unsigned char *pk, |
| 8 | unsigned char *pw, unsigned long long pwlen |
| 9 | ) |
| 10 | { |
| 11 | unsigned char az[64]; |
| 12 | ge_p3 A; |
| 13 | |
| 14 | crypto_hash_sha512(az,pw,pwlen); |
| 15 | az[0] &= 248; |
| 16 | az[31] &= 63; |
| 17 | az[31] |= 64; |
| 18 | |
| 19 | ge_scalarmult_base(&A,az); |
| 20 | ge_p3_tobytes(pk,&A); |
| 21 | |
| 22 | return 0; |
| 23 | } |
| 24 |