You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.[Install Docker](https://docs.docker.com/get-docker) or in the [Install Docker.md](./INSTALL_docker.md).
23
23
1. Clone this repository, then change into the directory containing the `Dockerfile`.
24
24
1. Build Container
25
-
Build the container with `docker build . -t cryptopt`. (`.` is the *build context*. It's the path containing the `Dockerfile`)
26
-
This can take a while. (Maybe around 20 minutes, depending on Internet bandwidth and machine) (Note: Depending on your Docker version, it is expected that the some output is red. This is warnings of the build process piped to stderr).
27
-
The build was successful if it ends `naming to docker.io/library/cryptopt` (or `Sucessfully tagged cryptopt:latest`)
28
-
The build command will create a container image tagged `cryptopt`, where all the dependencies are installed and the projects are built, ready to go.
25
+
Build the container with `docker build . -t cryptopt`. (`.` is the _build context_. It's the path containing the `Dockerfile`)
26
+
This can take a while. (Maybe around 20 minutes, depending on Internet bandwidth and machine) (Note: Depending on your Docker version, it is expected that the some output is red. This is warnings of the build process piped to stderr).
27
+
The build was successful if it ends `naming to docker.io/library/cryptopt` (or `Sucessfully tagged cryptopt:latest`)
28
+
The build command will create a container image tagged `cryptopt`, where all the dependencies are installed and the projects are built, ready to go.
29
29
30
30
1. Run the container image with `docker run --name CryptOpt -ti cryptopt zsh` -> you are now in the built project, your terminal should change to something like `abcdef1234#`
31
31
32
-
33
32
## Bare Metal
34
-
CryptOpt itself will only write files in the operating systems' temp directory (`/tmp/` on Linux) and in its own subdirectories.
35
-
It will require internet access to download the (Node.js) runtime and dependencies
33
+
34
+
CryptOpt itself will only write files in the operating system's temp directory (`/tmp/` on Linux) and in its own subdirectories.
35
+
It will require Internet access to download the (Node.js) runtime and dependencies
1. Clone the repo with `--recurse-submodules` to also clone submodules for a bunch of useful scripts.
40
40
1. Enable performance counters `echo "1" | sudo tee /proc/sys/kernel/perf_event_paranoid` ([MeasureSuite](https://0xADE1A1DE.github.io/MeasureSuite) will otherwise fall back to use `RDTSCP` to count cycles)
41
41
1. Build CryptOpt with `make all`. (or `DEBUG=1 make all` if you want debug info and `--verbose` Will slow down execution by around 50%)
42
-
CryptOpt already contains pre-built binaries for fiat-crypto.
43
-
If you want to build them fresh, too, follow the build instructions in [the Dockerfile](./Dockerfile) or [on Fiat-Cryptography's GitHub](https://github.com/mit-plv/fiat-crypto).
44
-
Then copy the standalone-ocaml binaries from `./src/ExtractionOCaml/{dettman_multiplication,solinas_reduction,unsaturated_solinas,word_by_word_montgomery}` to `./src/bridge/fiat-bridge/data`
45
-
42
+
CryptOpt already contains pre-built binaries for fiat-crypto.
43
+
If you want to build them fresh, too, follow the build instructions in [the Dockerfile](./Dockerfile) or [on Fiat-Cryptography's GitHub](https://github.com/mit-plv/fiat-crypto).
44
+
Then copy the standalone-ocaml binaries from `./src/ExtractionOCaml/{dettman_multiplication,solinas_reduction,unsaturated_solinas,word_by_word_montgomery}` to `./src/bridge/fiat-bridge/data`
45
+
1. If you want to use uiCA prediction instead of running the code natively, install [uiCA](https://github.com/andreas-abel/uiCA) and create a link to the `uiCA.py` next to `./CryptOpt`, e.g `ln -s ln -s ~/github/uiCA/uiCA.py ~/github/CryptOpt/uiCA`. Then run CryptOpt with `--objectiveFunction=uiCA --uicaarch=SKL` to use the prediction of `uiCA` with the Skylake architecture. (this is currently not supported in the Docker conainer, because I didn't get around doing it.) This feature also needs `asmline` in `PATH`, which comes with installing AssemblyLine globally. This also disables Monkey-Testing.
msg: "measuresuite.measure should return a result but didn't. RES/generic_error_{A,B}.asm as been written for debug.",
21
+
msg: "measureUtil.measure should return a result but didn't. RES/generic_error_{A,B}.asm as been written for debug.",
22
22
},
23
23
measureIncorrect: {
24
24
exitCode: 21,
25
-
msg: `measuresuite.measure should return a result but didn't, because the result is not the same as per measureCheck. RES/tested_incorrect{_A.asm,_B.asm,.json} haven been written for debug.`,
25
+
msg: `measureUtil.measure should return a result but didn't, because the result is not the same as per measureCheck. RES/tested_incorrect{_A.asm,_B.asm,.json} haven been written for debug.`,
26
26
},
27
27
measureInvalid: {
28
28
exitCode: 22,
29
-
msg: `measuresuite.measure should return a result but didn't, because the ASM string could not be assembled. RES/tested_incorrect{_A.asm,_B.asm,.json} haven been written for debug.`,
29
+
msg: `measureUtil.measure should return a result but didn't, because the ASM string could not be assembled. RES/tested_incorrect{_A.asm,_B.asm,.json} haven been written for debug.`,
30
30
},
31
31
measureInsufficientData: {
32
32
exitCode: 23,
33
-
msg: "measuresuite.measure did not yield even one data point.",
33
+
msg: "measureUtil.measure did not yield even one data point.",
34
34
},
35
35
measureCannotAnalyze: {
36
36
exitCode: 24,
37
-
msg: "measuresuite.measure did yield data points, but could not be analyzed.",
37
+
msg: "measureUtil.measure did yield data points, but could not be analyzed.",
"Defines if memory reads are contraint. 'none' will not enforce anything. All reads are permitted at any time. 'all' enforces that no read from any `argN[n]` happens after any write to `outN[n]`. 'out1-arg1' enforces that no read from arg1[n] is permitted after `out1[n]` has been written (essentially permits mul(r,r,x) and sq(a,a); but not if elemets overlap but not align. (e.g. mul(r+1,r,x)))",
217
223
choices: MEMORY_CONSTRAINTS_OPTIONS,
218
224
})
225
+
.option("uicaarch",{
226
+
default: "SKL",
227
+
string: true,
228
+
describe:
229
+
"Requires --objectiveFunction=uiCA. Then, CryptOpt uses estimation of uiCA instead of running the code natively. This option specifies the simulated architecture. Ensure uiCA is available in the CryptOpt directory. See INSTALL.md for details.",
230
+
choices: UICA_OPTIONS,
231
+
})
232
+
.option("objectiveFunction",{
233
+
default: "cycles",
234
+
string: true,
235
+
describe:
236
+
"The opjective function which describes which mutation should be kept or discarded. Options: 'cycles' run on hardware, use cycles; stack: size of the used stack slots; length: purely optimise for fewer instructions; uiCA: use uiCA's estimation. Everything but cycles effectively disables monkey-testing becuase the code is not executed.",
0 commit comments