-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun_curve25519_with_mul.py
26 lines (26 loc) · 1.11 KB
/
run_curve25519_with_mul.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
import settings
import claripy
settings.WARNING_ADDRESS = 0x1fcb0
settings.VERBOSE = True
settings.DEBUG = True
settings.TARGET_BINARY = "/home/stefan/Documents/Graduation/RISC-V-toolchain/riscv/Programs/WithMultiplication/build/program.elf"
settings.TARGET_ADDRESS = 0x200116c4
settings.r = claripy.BVS("result", 32*8)
settings.pointerR= 100000
settings.n = claripy.BVS("n", 32*8)
settings.pointerN=110000
settings.g = claripy.BVS("g", 32*8)
settings.pointerG=120000
settings.params = [settings.pointerR, settings.pointerN, settings.pointerG]
settings.secret = settings.n.concat(settings.g).concat(settings.r)
#settings.constraints = [claripy.SLT(settings.A, 5), claripy.SGE(settings.A, 1)]
settings.skips = [(0x20012704, 0x20012e68), (0x2001419c, 0x200147a8)]
from pluginTime import TIME_STRATEGY_SHORTEST
settings.TIME_STRATEGY = TIME_STRATEGY_SHORTEST
def stateInit(startState):
startState.memory.store(settings.pointerR, settings.r, 32)
startState.memory.store(settings.pointerN, settings.n, 32)
startState.memory.store(settings.pointerG, settings.g, 32)
return True
settings.stateInit = stateInit
import tool