src/ed25519/keypair.c

filter: Statementstmt 100% 10 / 10 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 10 / 10 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/Net/SSH/Perl/Util/SSH1Misc.pm ↑ Summary src/ed25519/sc.c »
1 #include <string.h>
2 #include "ed25519.h"
3 #include "sha512.h"
4 #include "ge.h"
5  
6  
7 1 void ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed) {
8 ge_p3 A;
9  
10 1 sha512(seed, 32, private_key);
11 1 private_key[0] &= 248;
12 1 private_key[31] &= 63;
13 1 private_key[31] |= 64;
14  
15 1 ge_scalarmult_base(&A, private_key);
16 1 ge_p3_tobytes(public_key, &A);
17  
18 1 memmove(private_key, seed, 32);
19 1 memmove(private_key + 32, public_key, 32);
20 1 }
« blib/lib/Net/SSH/Perl/Util/SSH1Misc.pm ↑ Summary src/ed25519/sc.c »