Skip to content

Commit

Permalink
chore: Merge branch 'release/v12.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuthor committed Jul 11, 2023
2 parents a3bae2c + fde7035 commit 153ce22
Show file tree
Hide file tree
Showing 21 changed files with 818 additions and 1,274 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to this project will be documented in this file.

## [12.0.0] - 2023-07-11

### Changed

- use CryptoCore v9.0
- remove generics
- update namings to follow paper updates
- harden zeroization of private data

## [11.0.2] - 2023-05-31

### Documentation
Expand Down
10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cosmian_cover_crypt"
version = "11.0.2"
version = "12.0.0"
authors = [
"Théophile Brezot <[email protected]>",
"Bruno Grieder <[email protected]>",
Expand All @@ -22,18 +22,20 @@ name = "benches"
harness = false

[features]
serialization = ["base64"]
serialization = []
test_utils = ["base64"]
full_bench = ["serialization"]
hybridized_bench = []

[dependencies]
base64 = { version = "0.21.0", optional = true }
cosmian_crypto_core = "7.1.0"
# TODO (TBZ): why do we need `std` feature here?
cosmian_crypto_core = { version = "9.0.0", default-features = false, features = ["ser", "sha3", "aes", "curve25519"] }
pqc_kyber = { version = "0.4", features = ["std", "hazmat"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tiny-keccak = { version = "2.0.2", features = ["shake"] }
zeroize = "1.6.0"

[dev-dependencies]
base64 = { version = "0.21.0" }
criterion = { version = "0.4", features = ["html_reports"], default_features = false }
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Country::Spain)` would be converted into two partitions. The encryption policy
The size of the serialized keys and encapsulation is given by the following formulas:

- master secret key:
$$2 \cdot L_{sk} + \texttt{LEB128sizeof}(|\mathcal{P}|) + \sum\limits_{p~\in~\mathcal{P}} \left( \texttt{LEB128sizeof}(\texttt{sizeof}(p)) + \texttt{sizeof}(p) + 1 + L_{sk} + \delta_{p,~h} \cdot L_{sk}^{pq}\right)$$
$$3 \cdot L_{sk} + \texttt{LEB128sizeof}(|\mathcal{P}|) + \sum\limits_{p~\in~\mathcal{P}} \left( \texttt{LEB128sizeof}(\texttt{sizeof}(p)) + \texttt{sizeof}(p) + 1 + L_{sk} + \delta_{p,~h} \cdot L_{sk}^{pq}\right)$$
- public key:
$$2 \cdot L_{pk} + \texttt{LEB128sizeof}(|\mathcal{P}|) + \sum\limits_{p~\in~\mathcal{P}} \left( \texttt{LEB128sizeof}(\texttt{sizeof}(p)) + \texttt{sizeof}(p) + 1 + L_{pk} + \delta_{p,~h} \cdot L_{pk}^{pq}\right)$$
- user secret key:
Expand Down
31 changes: 18 additions & 13 deletions benches/BENCHMARKS_classic.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
# Benchmarks for CoverCrypt: classic implementation (pre-quantum)
# Benchmarks for Covercrypt: classic implementation (pre-quantum)

## Table of Contents

- [Overview](#overview)
- [Benchmark Results](#benchmark-results)
- [Header encryption](#header-encryption)
- [Header encryption + decryption](#header-encryption-and-decryption)
- [Key serialization](#key-serialization)
- [Header serialization](#header-serialization)
- [Header encryption](#header-encryption)
- [Header encryption and decryption](#header-encryption-and-decryption)
- [Key serialization](#key-serialization)
- [Header serialization](#header-serialization)

## Overview

This is a benchmark comparison report.

## Benchmark Results

### Header encryption

| | `1 partition(s), 1 access` | `2 partition(s), 1 access` | `3 partition(s), 1 access` | `4 partition(s), 1 access` | `5 partition(s), 1 access` |
|:-------|:------------------------------------|:------------------------------------|:------------------------------------|:------------------------------------|:------------------------------------ |
| | `293.43 us` (**1.00x**) | `367.53 us` (*1.25x slower*) | `450.77 us` (*1.54x slower*) | `588.11 us` (*2.00x slower*) | `627.62 us` (*2.14x slower*) |
| | `133.32 us` (**1.00x**) | `182.22 us` (*1.37x slower*) | `230.37 us` (*1.73x slower*) | `278.18 us` (*2.09x slower*) | `335.55 us` (*2.52x slower*) |

### Header encryption and decryption

| | `ciphertexts with 1 partition(s), usk with 1 partitions` | `ciphertexts with 2 partition(s), usk with 1 partitions` | `ciphertexts with 3 partition(s), usk with 1 partitions` | `ciphertexts with 4 partition(s), usk with 1 partitions` | `ciphertexts with 5 partition(s), usk with 1 partitions` | `ciphertexts with 1 partition(s), usk with 2 partitions` | `ciphertexts with 2 partition(s), usk with 2 partitions` | `ciphertexts with 3 partition(s), usk with 2 partitions` | `ciphertexts with 4 partition(s), usk with 2 partitions` | `ciphertexts with 5 partition(s), usk with 2 partitions` | `ciphertexts with 1 partition(s), usk with 3 partitions` | `ciphertexts with 2 partition(s), usk with 3 partitions` | `ciphertexts with 3 partition(s), usk with 3 partitions` | `ciphertexts with 4 partition(s), usk with 3 partitions` | `ciphertexts with 5 partition(s), usk with 3 partitions` |
|:-------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------ |
| | `491.23 us` (✅ **1.00x**) | `632.31 us` (*1.29x slower*) | `752.58 us` (*1.53x slower*) | `876.77 us` (*1.78x slower*) | `1.04 ms` (*2.12x slower*) | `487.07 us` (✅ **1.01x faster**) | `662.65 us` (*1.35x slower*) | `852.29 us` (*1.74x slower*) | `1.01 ms` (*2.06x slower*) | `1.16 ms` (*2.37x slower*) | `565.50 us` (*1.15x slower*) | `795.23 us` (*1.62x slower*) | `1.01 ms` (*2.05x slower*) | `1.22 ms` (*2.48x slower*) | `1.43 ms` (*2.91x slower*) |
| | `ciphertexts with 1 partition(s), usk with 1 partitions` | `ciphertexts with 2 partition(s), usk with 1 partitions` | `ciphertexts with 3 partition(s), usk with 1 partitions` | `ciphertexts with 4 partition(s), usk with 1 partitions` | `ciphertexts with 5 partition(s), usk with 1 partitions` | `ciphertexts with 1 partition(s), usk with 2 partitions` | `ciphertexts with 2 partition(s), usk with 2 partitions` | `ciphertexts with 3 partition(s), usk with 2 partitions` | `ciphertexts with 4 partition(s), usk with 2 partitions` | `ciphertexts with 5 partition(s), usk with 2 partitions` | `ciphertexts with 1 partition(s), usk with 3 partitions` | `ciphertexts with 2 partition(s), usk with 3 partitions` | `ciphertexts with 3 partition(s), usk with 3 partitions` | `ciphertexts with 4 partition(s), usk with 3 partitions` | `ciphertexts with 5 partition(s), usk with 3 partitions` | `ciphertexts with 1 partition(s), usk with 4 partitions` | `ciphertexts with 2 partition(s), usk with 4 partitions` | `ciphertexts with 3 partition(s), usk with 4 partitions` | `ciphertexts with 4 partition(s), usk with 4 partitions` | `ciphertexts with 5 partition(s), usk with 4 partitions` | `ciphertexts with 1 partition(s), usk with 5 partitions` | `ciphertexts with 2 partition(s), usk with 5 partitions` | `ciphertexts with 3 partition(s), usk with 5 partitions` | `ciphertexts with 4 partition(s), usk with 5 partitions` | `ciphertexts with 5 partition(s), usk with 5 partitions` |
|:-------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------|:------------------------------------------------------------------ |
| | `236.02 us` (**1.00x**) | `293.92 us` (*1.25x slower*) | `356.80 us` (*1.51x slower*) | `419.65 us` (*1.78x slower*) | `480.53 us` (*2.04x slower*) | `229.46 us` (**1.03x faster**) | `310.51 us` (*1.32x slower*) | `406.11 us` (*1.72x slower*) | `484.32 us` (*2.05x slower*) | `565.05 us` (*2.39x slower*) | `227.64 us` (**1.04x faster**) | `339.10 us` (*1.44x slower*) | `450.91 us` (*1.91x slower*) | `543.62 us` (*2.30x slower*) | `645.11 us` (*2.73x slower*) | `312.85 us` (*1.33x slower*) | `446.54 us` (*1.89x slower*) | `572.54 us` (*2.43x slower*) | `689.37 us` (*2.92x slower*) | `810.78 us` (*3.44x slower*) | `231.57 us` (**1.02x faster**) | `375.80 us` (*1.59x slower*) | `527.09 us` (*2.23x slower*) | `661.97 us` (*2.80x slower*) | `814.49 us` (*3.45x slower*) |

### Key serialization

| | `MSK` | `MPK` | `USK 1 partition` |
|:-------|:--------------------------|:----------------------------------|:-------------------------------- |
| | `443.45 ns` (**1.00x**) | `85.07 us` (*191.84x slower*) | `58.34 ns` (**7.60x faster**) |
| | `MSK` | `MPK` | `USK 1 partition` |
|:-------|:--------------------------|:----------------------------------|:--------------------------------- |
| | `801.07 ns` (**1.00x**) | `83.76 us` (*104.55x slower*) | `118.50 ns` (**6.76x faster**) |

### Header serialization

| | `1 partition(s)` | `2 partition(s)` | `3 partition(s)` | `4 partition(s)` | `5 partition(s)` |
|:-------|:--------------------------|:--------------------------------|:--------------------------------|:--------------------------------|:-------------------------------- |
| | `12.15 us` (**1.00x**) | `12.20 us` (**1.00x slower**) | `12.16 us` (**1.00x slower**) | `12.19 us` (**1.00x slower**) | `12.13 us` (**1.00x faster**) |
| | `10.27 us` (**1.00x**) | `10.25 us` (**1.00x faster**) | `10.40 us` (**1.01x slower**) | `10.41 us` (**1.01x slower**) | `10.53 us` (**1.02x slower**) |

---
Made with [criterion-table](https://github.com/nu11ptr/criterion-table)
Loading

0 comments on commit 153ce22

Please sign in to comment.