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

Break public API, simplify key mgmt and tests #1

Draft
wants to merge 32 commits into
base: fix_rust_crypto_et_al
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2d41a17
Merge pull request #3 from umccr/fix_rust_crypto_et_al
brainstorm Jan 31, 2024
068a6c0
Changing and breaking public APIs as discussed w/ @mmalenic: i.e: no …
brainstorm Feb 5, 2024
9a81982
Define public API for decrypt/encrypt, remove filesystem-based helper…
brainstorm Feb 6, 2024
39132a9
Add ssh-keys to replace low level equivalents
brainstorm Feb 6, 2024
05e0bf8
[ci skip] Migrating more logic from async-crypt4gh to crypt4gh-rust
brainstorm Feb 7, 2024
e9f1b63
Add more async-related deps and helpers (tokio, futures, tokio-io, et…
brainstorm Feb 9, 2024
e03d95b
[ci skip] More use/project hierarchy refactoring
brainstorm Feb 9, 2024
3049ea1
More sweeping changes on error control, need to consolidate PrivateKe…
brainstorm Feb 11, 2024
85041ea
Add Noodles as a dependency for some test that require it...
brainstorm Feb 12, 2024
5e9b0c5
More rearranging and cleanup of imports, error definitions
brainstorm Feb 12, 2024
49b2c2c
Remove custom Result type and be explicit about Crypt4GHErrors everyw…
brainstorm Feb 12, 2024
0ecba8c
[ci skip] More cleanups before tackling other errors
brainstorm Feb 12, 2024
07a9052
Move in-file tests to tests/ to aid refactoring better (too high erro…
brainstorm Feb 16, 2024
df36586
Add Marko and myself as co-authors in the crate
brainstorm Feb 16, 2024
2747185
Move header packets test away to tests/
brainstorm Feb 16, 2024
1e0d351
Remove specific rustls::PrivateKey which doesn't seem to be exposed i…
brainstorm Feb 16, 2024
6222a75
Keys is not KeyPairInfo, many minor fixes (and more expected breakage…
brainstorm Feb 16, 2024
352bdf6
Refactoring header.rs to get rid of free-standing functions, thinking…
brainstorm Feb 16, 2024
54dd2ef
Sorting through the functions that must be public for Header and whic…
brainstorm Feb 19, 2024
0e685e9
Refactor the header structs so that it mirrors the Crypt4GH spec 1-1,…
brainstorm Feb 19, 2024
1488a77
Vec<u8> instead of u8... see https://bcantrill.dtrace.org/2020/10/11/…
brainstorm Feb 19, 2024
3db1a41
Corrections on data types gathered from the spec and annotated: secti…
brainstorm Feb 19, 2024
ab23e6d
Introduce encrypted_data, move segments, fixing header function names…
brainstorm Mar 5, 2024
2d4be96
refactor: review session
mmalenic Mar 7, 2024
73dbc9a
Bump up crate versions after hiatus...
brainstorm Jul 15, 2024
5362810
Sea of red for the spec-based refactor, need to discuss design w/ @mm…
brainstorm Jul 15, 2024
ee44d86
Merge branch 'break_public_api_simplify_key_mgmt_and_tests' of github…
brainstorm Jul 15, 2024
918a8c6
Refactor and flatten decrypt/encrypt modules. Finalise first draft on…
brainstorm Jul 22, 2024
ab792b5
No 'HeaderInfo' in the spec
brainstorm Jul 22, 2024
0b3f25b
More refactoring, a bit more focus on consolidating different header …
brainstorm Jul 24, 2024
948033f
KeyPairInfo is no more, simplify to just KeyPair, consolidate differe…
brainstorm Jul 26, 2024
4882561
Remove all tests, too much noise and there's heavy API changes that w…
brainstorm Jul 26, 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
1,516 changes: 1,464 additions & 52 deletions Cargo.lock

Large diffs are not rendered by default.

23 changes: 17 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "crypt4gh"
version = "0.4.1"
authors = ["Roberto <[email protected]>"]
authors = ["Roberto <[email protected]>", "Marko Malenic <[email protected]>", "Roman Valls Guimera <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
description = "Encryption and decryption implementation of the Crypt4GH encryption format."
Expand All @@ -23,10 +23,10 @@ path = "src/bin.rs"
clap = { version = "4", features = ["derive", "env"] }
regex = "1.5"
rpassword = "7"
base64 = "0.21"
base64 = "0.22"
lazy_static = "1.4"
chacha20poly1305 = "0.10"
crypto_kx = { version = "0.2.1" }
crypto_kx = { version = "0.2" }
scrypt = { version = "0.11" }
bcrypt-pbkdf = { version = "0.10" }
aes = { version = "0.8" }
Expand All @@ -38,15 +38,26 @@ serde = { version = "1", features = ["derive"] }
log = "0.4"
pretty_env_logger = "0.5"
thiserror = "1"
itertools = "0.11"
itertools = "0.13"
rand = "0.8"
rand_chacha = "0.3"
ed25519_to_curve25519 = "0.2"

curve25519-dalek = "4.0.0"
curve25519-dalek = "4"
ssh-key = { version = "0.6.4", features = ["ed25519"] }
bytes = "1.5.0"
rustls = "0.23"
tokio = { version = "1", features = [ "io-util", "test-util", "macros", "rt-multi-thread" ] }
futures = "0.3"
pin-project-lite = "0.2.13"
tokio-util = { version = "0.7", features = ["codec"] }
futures-util = "0.3.30"

[dev-dependencies]
testresult = "0.3"
testresult = "0.4"
noodles-bam = "0.65"
noodles-sam = "0.62"
noodles = { version = "0.78", features = [ "sam", "bam", "async" ] }

[profile.release]
lto = true
Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,12 @@ Use the exposed functions:
```rust
pub fn encrypt<R: Read, W: Write>(
recipient_keys: &HashSet<Keys>,
read_buffer: &mut R,
write_buffer: &mut W,
range_start: usize,
range_span: Option<usize>
) -> Result<()>

pub fn decrypt<R: Read, W: Write>(
keys: Vec<Keys>,
read_buffer: &mut R,
write_buffer: &mut W,
range_start: usize,
range_span: Option<usize>,
sender_pubkey: Option<Vec<u8>>,
Expand All @@ -107,15 +103,11 @@ pub fn decrypt<R: Read, W: Write>(
pub fn reencrypt<R: Read, W: Write>(
keys: Vec<Keys>,
recipient_keys: HashSet<Keys>,
read_buffer: &mut R,
write_buffer: &mut W,
trim: bool,
) -> Result<()>

pub fn rearrange<R: Read, W: Write>(
keys: Vec<Keys>,
read_buffer: &mut R,
write_buffer: &mut W,
range_start: usize,
range_span: Option<usize>,
) -> Result<()>
Expand Down
280 changes: 0 additions & 280 deletions src/bin.rs

This file was deleted.

Loading