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

zcash_note_encryption generalization #746

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2f3132f
Allowing for variable note plaintext and ciphertext sizes via moving …
vivek-arte Sep 28, 2022
d5deb22
cleaning up and removing commented code, ready for review
vivek-arte Sep 30, 2022
9ff53ec
partial improvements based on comments
vivek-arte Oct 5, 2022
ea580e0
added to encrypt_note_plaintext
vivek-arte Oct 6, 2022
e0ab31e
added to try_note_decryption_inner
vivek-arte Oct 6, 2022
72ae97c
removed convert_to_compact_plaintext function in favour of From trait
vivek-arte Oct 6, 2022
062d40a
completed AsMut related changes for the librustzcash
vivek-arte Oct 7, 2022
4bb7f94
using From trait for combining NotePlaintextBytes and tag into EncNot…
vivek-arte Oct 20, 2022
1344aa7
removing NoteCiphertext<D> enum, adding enc_ciphertext_compact fn to …
vivek-arte Oct 31, 2022
d35c32c
changing function signatures to borrow input arguments
vivek-arte Oct 31, 2022
bf284fc
changing ShieldedOutput function return types
vivek-arte Nov 2, 2022
bc136f2
adding improvements based on review - From trait for CompactNotePlain…
vivek-arte Nov 24, 2022
2ec2801
updated constant names
PaulLaux Dec 19, 2022
29ed088
Use 0.8.1
alexeykoren Dec 13, 2022
0993830
Use Rust 1.61.0 in CI
alexeykoren Dec 13, 2022
89bd654
New orchard version
alexeykoren Dec 18, 2022
d006364
Add TODO for burn reading/writing
alexeykoren Dec 18, 2022
519529a
update
PaulLaux Dec 26, 2022
c27969d
fmt
PaulLaux Dec 26, 2022
3a185c6
updated rust version
PaulLaux Dec 26, 2022
f56db58
removed as_ref()
PaulLaux Dec 28, 2022
77844f4
minor update
PaulLaux Jan 10, 2023
c8beb1f
updated version
PaulLaux Jan 12, 2023
f0c686d
commented out test code
PaulLaux Jan 12, 2023
d318627
minor fix
PaulLaux Jan 22, 2023
57db56b
updated test and cleanup
PaulLaux Jan 23, 2023
db9d03d
updated orchard commit in cargo.toml
PaulLaux Jan 23, 2023
cda1469
Merge branch 'zsa1' into encryption_generalization
PaulLaux Jan 24, 2023
b6f28c2
fmt
PaulLaux Jan 24, 2023
d08c1b7
fixed zcash_client_backend and simplified cargo.toml
PaulLaux Jan 24, 2023
6183ec4
fixed benches/noted_decryption
PaulLaux Jan 24, 2023
ce74cd5
updated Cargo.toml
PaulLaux Jan 31, 2023
07c377d
removed .as_mut()
PaulLaux Jan 31, 2023
70020cf
Merge pull request #18 from QED-it/encryption_generalization
PaulLaux Jan 31, 2023
e033ab7
fmt
PaulLaux Feb 8, 2023
4b17681
fmt2
PaulLaux Feb 8, 2023
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
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
toolchain: 1.61.0
override: true

- name: Fetch path to Zcash parameters
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
toolchain: 1.61.0
override: true
- name: Add target
run: rustup target add ${{ matrix.target }}
Expand All @@ -78,7 +78,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
toolchain: 1.61.0
override: true
# Build benchmarks to prevent bitrot
- name: Build benchmarks
Expand All @@ -88,20 +88,20 @@ jobs:
args: --all --benches

clippy:
name: Clippy (1.56.1)
name: Clippy (1.61.0)
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
toolchain: 1.61.0
components: clippy
override: true
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
name: Clippy (1.56.1)
name: Clippy (1.61.0)
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings

Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
toolchain: 1.61.0
override: true
- name: cargo fetch
uses: actions-rs/cargo@v1
Expand All @@ -197,7 +197,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
toolchain: 1.61.0
override: true

# cargo fmt does not build the code, and running it in a fresh clone of
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ zcash_encoding = { path = "components/zcash_encoding" }
zcash_note_encryption = { path = "components/zcash_note_encryption" }
schemer = { git = "https://github.com/aschampion/schemer.git", rev = "6726b60f43f72c6e24a18d31be0ec7d42829e5e1" }
schemer-rusqlite = { git = "https://github.com/aschampion/schemer.git", rev = "6726b60f43f72c6e24a18d31be0ec7d42829e5e1" }
orchard = { version = "0.3", git = "https://github.com/QED-it/orchard", rev = "35da288c7867c5b0fb0ae84e444915689e49084c" }
2 changes: 1 addition & 1 deletion components/zcash_note_encryption/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/zcash/librustzcash"
readme = "README.md"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.56.1"
rust-version = "1.61.0"
categories = ["cryptography::cryptocurrencies"]

[package.metadata.docs.rs]
Expand Down
8 changes: 4 additions & 4 deletions components/zcash_note_encryption/src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use alloc::vec::Vec; // module is alloc only

use crate::{
try_compact_note_decryption_inner, try_note_decryption_inner, BatchDomain, EphemeralKeyBytes,
ShieldedOutput, COMPACT_NOTE_SIZE, ENC_CIPHERTEXT_SIZE,
ShieldedOutput,
};

/// Trial decryption of a batch of notes with a set of recipients.
Expand All @@ -16,7 +16,7 @@ use crate::{
/// provided, along with the index in the `ivks` slice associated with
/// the IVK that successfully decrypted the output.
#[allow(clippy::type_complexity)]
pub fn try_note_decryption<D: BatchDomain, Output: ShieldedOutput<D, ENC_CIPHERTEXT_SIZE>>(
pub fn try_note_decryption<D: BatchDomain, Output: ShieldedOutput<D>>(
ivks: &[D::IncomingViewingKey],
outputs: &[(D, Output)],
) -> Vec<Option<((D::Note, D::Recipient, D::Memo), usize)>> {
Expand All @@ -32,14 +32,14 @@ pub fn try_note_decryption<D: BatchDomain, Output: ShieldedOutput<D, ENC_CIPHERT
/// provided, along with the index in the `ivks` slice associated with
/// the IVK that successfully decrypted the output.
#[allow(clippy::type_complexity)]
pub fn try_compact_note_decryption<D: BatchDomain, Output: ShieldedOutput<D, COMPACT_NOTE_SIZE>>(
pub fn try_compact_note_decryption<D: BatchDomain, Output: ShieldedOutput<D>>(
ivks: &[D::IncomingViewingKey],
outputs: &[(D, Output)],
) -> Vec<Option<((D::Note, D::Recipient), usize)>> {
batch_note_decryption(ivks, outputs, try_compact_note_decryption_inner)
}

fn batch_note_decryption<D: BatchDomain, Output: ShieldedOutput<D, CS>, F, FR, const CS: usize>(
fn batch_note_decryption<D: BatchDomain, Output: ShieldedOutput<D>, F, FR>(
ivks: &[D::IncomingViewingKey],
outputs: &[(D, Output)],
decrypt_inner: F,
Expand Down
Loading