-
Notifications
You must be signed in to change notification settings - Fork 1
/
mul256c.cpp
executable file
·38 lines (37 loc) · 1.53 KB
/
mul256c.cpp
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
#include "ttmath/ttmath.h"
typedef ttmath::UInt<TTMATH_BITS(256)> u256;
int main() {
u256 s("0x802431afcbce1fc194c9eaa417b2fb67dc75a95db0bc7ec6b1c8af11df6a1da9");
u256 r;
for (u256 i = 0; i < 1048576; ++i) {
volatile unsigned v = 0;
u256 z = s + v;
u256 y("0xa1f5aac137876480252e5dcac62c354ec0d42b76b0642b6181ed099849ea1d57");
u256 x = z;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x = z;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x = z;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x = z;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x = z;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x = z;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x = z;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x = z;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y; x *= y;
r = x;
}
return r != "0xf68cec53bdbebd0d8a2587f4716010120f43bc8873f6d3b26c697204beaf2a29";
}