aboutsummaryrefslogtreecommitdiff
path: root/src/cm/custom.h
blob: ddb89fe1f3e641b55b918a4c8387900e0c1cf7ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * ecgen, tool for generating Elliptic curve domain parameters
 * Copyright (C) 2017 J08nY
 */
#ifndef ECGEN_CUSTOM_H
#define ECGEN_CUSTOM_H

#include "misc/config.h"
#include "misc/types.h"

typedef struct {
	/* Stuff filled with custom_quadr_next. */
	GEN p;
	GEN t;
	GEN D;

	/* Stuff for saving state. */
	GEN order;
	GEN r;
	GEN i;
	GEN* Sp;
	size_t nprimes;
} custom_quadr_t;

/**
 * Algorithm mostly from:
 *     Constructing elliptic curves of prime order
 *     by Reinier Broker and Peter Stevenhagen
 * @return
 */
curve_t* custom_curve();

#endif  // ECGEN_CUSTOM_H