Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions compiler/entry/jasmin2ec.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,16 @@ let parse_and_extract arch call_conv idirs =
exit 1

let model =
let alts =
[ ("normal", Normal); ("CT", ConstantTime); ("CTG", ConstantTimeGlobal) ]
let with_decl = function
| "normal" -> "D"
| s -> s ^ "+D"
in
let models (kw, mode) = [
(kw, (mode, Normal));
(with_decl kw, (mode, DeclassifyConstant))
] in
let alts = List.concat_map models
[ ("CT", ConstantTime); ("CTG", ConstantTimeGlobal); ("normal", Normal) ]
in
let doc =
"Extraction model.
Expand All @@ -59,9 +67,11 @@ let model =
'cryptographic constant time' (if/while conditions, memory access
addresses, array indices, for loop bounds).
(Deprecated) $(b,CTG): Cryptographic constant time leakage is added to a
global variable."
global variable.
These options can be suffixed with a $(b,+D) in order to obtain
declassified value leakage (as in $(b,D), $(b,CT+D) and $(b,CTG+D))."
in
Arg.(value & opt (Arg.enum alts) Normal & info [ "m"; "model" ] ~doc)
Arg.(value & opt (Arg.enum alts) (Normal, Normal) & info [ "m"; "model" ] ~doc)

let array_model =
let alts =
Expand Down
Loading