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

[zk-sdk] Add errors, macros, and encryption modules #1019

Merged
merged 4 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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 change: 0 additions & 1 deletion zk-sdk/src/macros.rs → zk-sdk/src/encryption/macros.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Internal macros, used to defined the 'main' impls
macro_rules! define_add_variants {
(LHS = $lhs:ty, RHS = $rhs:ty, Output = $out:ty) => {
impl<'b> Add<&'b $rhs> for $lhs {
Expand Down
3 changes: 3 additions & 0 deletions zk-sdk/src/encryption/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
//! - Basic type-wrapper around the AES-GCM-SIV symmetric authenticated encryption scheme
//! implemented by [aes-gcm-siv](https://docs.rs/aes-gcm-siv/latest/aes_gcm_siv/) crate.

#[cfg(not(target_os = "solana"))]
#[macro_use]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, looking through this again, I don't think you need #[macro_use] either

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh oops, yeah I guess this is only required by old rust. Thanks! I will removed on a follow-up.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, actually it seems like if I removed this macro_use then the macros seem to be not accessible to other crates. Reading a bit on the macro_use attribute, it seems like this is required here?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, I thought the macros were only used internally. no worries then!

pub(crate) mod macros;
pub mod auth_encryption;
pub mod discrete_log;
pub mod elgamal;
Expand Down
3 changes: 0 additions & 3 deletions zk-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
// `clippy::op_ref` is turned off to prevent clippy from warning that this is not idiomatic code.
#![allow(clippy::arithmetic_side_effects, clippy::op_ref)]

#[cfg(not(target_os = "solana"))]
#[macro_use]
pub(crate) mod macros;
#[cfg(not(target_os = "solana"))]
pub mod encryption;

Expand Down
Loading