File Coverage

ed25519/src/keypair.c
Criterion Covered Total %
statement 8 8 100.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             #include "ed25519.h"
2             #include "sha512.h"
3             #include "ge.h"
4              
5              
6 1052           void ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed) {
7             ge_p3 A;
8              
9 1052           sha512(seed, 32, private_key);
10 1052           private_key[0] &= 248;
11 1052           private_key[31] &= 63;
12 1052           private_key[31] |= 64;
13              
14 1052           ge_scalarmult_base(&A, private_key);
15 1052           ge_p3_tobytes(public_key, &A);
16 1052           }