projects
/
proth.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
init
[proth.git]
/
proth_test.c
1
#include <time.h>
2
#include <stdio.h>
3
#include <string.h>
4
#include <stdint.h>
5
#include <stdbool.h>
6
7
#include <gmp.h>
8
9
10
11
int
main
(
void
)
12
{
13
mpz_t p
;
14
mpz_t exp
;
15
mpz_t base
;
16
mpz_t rop
;
17
18
mpz_init
(
p
);
19
mpz_init
(
exp
);
20
mpz_init
(
base
);
21
mpz_init
(
rop
);
22
23
mpz_set_ui
(
base
,
5
);
24
mpz_set_ui
(
exp
, (
13
-
1
)/
2
);
25
mpz_set_ui
(
p
,
13
);
26
27
mpz_powm
(
rop
,
base
,
exp
,
p
);
28
29
gmp_printf
(
"%Zd
\n
"
,
rop
);
30
31
mpz_clear
(
p
);
32
mpz_clear
(
exp
);
33
mpz_clear
(
base
);
34
mpz_clear
(
rop
);
35
}