Skip to content

Commit

Permalink
Adding Rust implementation of Alba (#13)
Browse files Browse the repository at this point in the history
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
4 people authored Sep 5, 2024
1 parent 544359d commit 2c7204f
Show file tree
Hide file tree
Showing 7 changed files with 1,125 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/rust-ci.yml
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-
1 change: 1 addition & 0 deletions caledonia/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
17 changes: 17 additions & 0 deletions caledonia/Cargo.toml
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"
Loading

0 comments on commit 2c7204f

Please sign in to comment.