-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Rust implementation of Alba (#13)
This PR aims at adding the Rust implementation of Alba. This includes: - Prehashed version & Bounded version: some TODO left to fully implement the recursive hash optimization and look at hash personalization, etc. - (limited) tests: positive and negative tests. Need to add randomized tests as well as property testing. - (limited) doc: Succinct comments on code that can be compiled with cargo doc - (limited) bench: bench in tests (add assert!(false) to display) with low parameters, need to separate these in distinct file. --------- Co-authored-by: Raphael Toledo <[email protected]> Co-authored-by: curiecrypt <[email protected]> Co-authored-by: curiecrypt <[email protected]>
- Loading branch information
1 parent
544359d
commit 2c7204f
Showing
7 changed files
with
1,125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Rust CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Uninstall pre-installed tools | ||
run: | | ||
rm -f ~/.cargo/bin/rust-analyzer | ||
rm -f ~/.cargo/bin/rustfmt | ||
rm -f ~/.cargo/bin/cargo-fmt | ||
- name: Update Rust toolchain and components | ||
run: | | ||
rustup update | ||
rustup component add rustfmt | ||
rustup component add clippy | ||
- name: Build | ||
run: cargo build --verbose | ||
working-directory: caledonia | ||
|
||
- name: Verify target directory exists | ||
run: | | ||
echo "Checking if target directory exists and is not empty" | ||
ls -la caledonia/target | ||
- name: Run tests | ||
run: cargo test --verbose | ||
working-directory: caledonia | ||
|
||
# - name: Run Clippy | ||
# run: cargo clippy -- -D warnings | ||
# working-directory: caledonia | ||
|
||
- name: Check format | ||
run: cargo fmt -- --check | ||
working-directory: caledonia | ||
|
||
- name: Build and test documentation | ||
run: cargo doc --no-deps --verbose | ||
working-directory: caledonia | ||
|
||
- name: Cache Cargo registry | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-registry- | ||
- name: Cache Cargo build | ||
uses: actions/cache@v3 | ||
with: | ||
path: caledonia/target | ||
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-build- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "caledonia" | ||
version = "0.1.0" | ||
edition = "2021" | ||
description = "A Rust implementation of Approximate Lower Bound Arguments (ALBAs)." | ||
categories = ["cryptography"] | ||
include = ["**/*.rs", "Cargo.toml", "README.md", ".gitignore"] | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
blake2 = "0.10.6" | ||
rand_core = "0.6.4" | ||
|
||
[dev-dependencies] | ||
rand = "0.8.5" | ||
rand_chacha = "0.3.1" |
Oops, something went wrong.