summaryrefslogtreecommitdiff
path: root/libs/libaxolotl/src/curve25519/ed25519/additions/ge_scalarmult_cofactor.c
blob: 6affbb05d55675c4c38273cddd9a95f0e506436e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "crypto_additions.h"
#include "ge.h"

/*
return 8 * p
*/

void ge_scalarmult_cofactor(ge_p3 *q, const ge_p3 *p)
{
  ge_p1p1 p1p1;
  ge_p2 p2;

  ge_p3_dbl(&p1p1, p);
  ge_p1p1_to_p2(&p2, &p1p1);

  ge_p2_dbl(&p1p1, &p2);
  ge_p1p1_to_p2(&p2, &p1p1);

  ge_p2_dbl(&p1p1, &p2);
  ge_p1p1_to_p3(q, &p1p1);
}