aboutsummaryrefslogtreecommitdiff
path: root/src/math/koblitz.h
blob: d2c62edcad3c0abd3d9c949d213d1c8c1a50f408 (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
34
35
36
37
38
39
40
/*
 * ecgen, tool for generating Elliptic curve domain parameters
 * Copyright (C) 2017-2018 J08nY
 */
#ifndef ECGEN_MATH_KOBLITZ_H
#define ECGEN_MATH_KOBLITZ_H

#include <stdbool.h>
#include "misc/types.h"

typedef struct {
	unsigned int m;
	unsigned int a;
	const char *hex_order;
} koblitz_t;

/**
 * @brief
 * @param curve
 * @return
 */
bool koblitz_is_curve(const curve_t *curve);

/**
 * @brief
 * @param m
 * @param a
 * @return
 */
const koblitz_t *koblitz_find(unsigned long m, unsigned long a);

/**
 * @brief
 * @param m
 * @param a
 * @return
 */
GEN koblitz_get_order(unsigned long m, unsigned long a);

#endif  // ECGEN_MATH_KOBLITZ_H