Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crypto Primitives Abstraction Layer #459

Merged
merged 23 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dcc06ed
Move state machine traits to their own module
jschneider-bensch Jan 25, 2024
c01c1ce
Create protocol crypto abstraction layer module
jschneider-bensch Jan 25, 2024
84eb161
Move Error back to `lib.rs`, define `CryptoError` variant
jschneider-bensch Jan 25, 2024
725e786
Implement basic crypto abstractions
jschneider-bensch Jan 25, 2024
7393dcb
Replace `hacspec_xyz` primtives with crypto abstraction layer
jschneider-bensch Jan 25, 2024
5723c9a
Fix clippy warnings
jschneider-bensch Jan 25, 2024
3c19d64
Let `libcrux` handle deserialization
jschneider-bensch Jan 25, 2024
4296624
Allow alg. choice by wrapping libcrux `Algorithm` types
jschneider-bensch Jan 25, 2024
a1491dd
Choose correct algorithms in noise example
jschneider-bensch Jan 25, 2024
4349d1c
Inlcude all of the example in the extraction
jschneider-bensch Jan 25, 2024
846d63f
Update lockfiles
jschneider-bensch Jan 25, 2024
c4b8345
`cargo fmt`
jschneider-bensch Jan 25, 2024
cc2ffa3
`dune fmt`
jschneider-bensch Jan 25, 2024
9b9335a
Merge branch 'main' into jonas/crypto-abstractions
jschneider-bensch Jan 25, 2024
784365a
Include noise example in toolchain tests
jschneider-bensch Jan 25, 2024
aba3bcd
Basic docs for crypto abstractions
jschneider-bensch Jan 25, 2024
dbfad38
Remove looping (unnecessary) printer
jschneider-bensch Jan 25, 2024
9a0316e
Allow slices in the input language for now
jschneider-bensch Jan 25, 2024
0d95f6c
Formatting....
jschneider-bensch Jan 25, 2024
ed92d44
Basic README for `hax-protocol-lib`
jschneider-bensch Jan 29, 2024
28a081e
Place doc comment correctly
jschneider-bensch Jan 29, 2024
784129d
Add crate-level documentation
jschneider-bensch Jan 29, 2024
8936e0c
Rename crypto abstractions module
jschneider-bensch Jan 29, 2024
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
171 changes: 171 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions engine/backends/proverif/proverif_backend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include
include On.Macro
include On.Question_mark
include On.Early_exit
include On.Slice
end)
(struct
let backend = Diagnostics.Backend.ProVerif
Expand All @@ -30,6 +31,7 @@ module SubtypeToInputLanguage
(* and type slice = Features.Off.slice *)
(* and type raw_pointer = Features.Off.raw_pointer *)
with type early_exit = Features.On.early_exit
and type slice = Features.On.slice
and type question_mark = Features.On.question_mark
and type macro = Features.On.macro
(* and type as_pattern = Features.Off.as_pattern *)
Expand Down Expand Up @@ -61,7 +63,6 @@ struct
let mutable_reference = reject
let mutable_pointer = reject
let reference = reject
let slice = reject
let raw_pointer = reject
let as_pattern = reject
let nontrivial_lhs = reject
Expand Down Expand Up @@ -286,17 +287,6 @@ module Print = struct
| TApp _ -> super#ty ctx ty
| _ -> string "bitstring"

method! expr_app : expr -> expr list -> generic_value list fn =
fun f args _generic_args ->
let args =
separate_map
(comma ^^ break 1)
(print#expr_at Expr_App_arg >> group)
args
in
let f = print#expr_at Expr_App_f f |> group in
f ^^ iblock parens args

method! literal : Generic_printer_base.literal_ctx -> literal fn =
fun _ctx -> function
| Int { value; negative; _ } ->
Expand Down
1 change: 1 addition & 0 deletions hax-lib-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ readme.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
libcrux = "0.0.2-pre.2"
19 changes: 19 additions & 0 deletions hax-lib-protocol/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Hax Protocol Library
This crate provides tools for protocol developers to write protcol
specifications for hax.

## Protocol Traits
To hax, a protocol is a collection of communicating state
machines. This module provides traits that describe parts of a state
machine's behaviour, specifically it provides traits for creating an
initial state, and for state transition behaviour when reading or
writing a message.

## Cryptographic Abstractions
Beside message passing and state transitions, a protocol of course
includes operations on the sent and received messages. For
cryptographic protocols, these will be of a fairly restricted set of
cryptoraphic primitive operations, which are provided in these
cryptographic abstractions. This allows protocol authors to specify
protocol party internal operations in a way that is easily accessible
to hax.
Loading
Loading