-
Notifications
You must be signed in to change notification settings - Fork 1
/
testboolefuncs.py
54 lines (39 loc) · 1.17 KB
/
testboolefuncs.py
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python
import sys
import fileinput
P = 115792089237316195423570985008687907853269984665640564039457584007908834671663
N = 115792089237316195423570985008687907852837564279074904382605163141518161494337
# skip = int("00000000000000000000000000000000000000000000000000000027eb78574a",16)
# skip = 100000000
skip = 0
def hexify(i):
return hex(i).replace("0x", "").replace("L", "").zfill(64)
data = []
for line in fileinput.input():
line = line.replace("0x", "").replace("L", "").replace("\n", "")
try:
data.append(int(line, 16))
except:
pass
import random
random.shuffle(data)
start = 0
end = len(data) - 1
mid = int(end / 2)
def diff(x, i, j):
if x not in [i, j]:
y = x % N
if skip < y:
return hexify(y)
for i in range(start, end):
for j in range(start, end):
if i != j:
x = data[i] and data[j]
if d := diff(x, data[i], data[j]):
print(d)
x = data[i] or data[j]
if d := diff(x, data[i], data[j]):
print(d)
x = data[i] ^ data[j]
if d := diff(x, data[i], data[j]):
print(d)