Skip to content

Commit

Permalink
Merge pull request #102 from InternetMaximalism/fix/wasm-compile
Browse files Browse the repository at this point in the history
Fix wasm compilation errors
  • Loading branch information
kbizikav authored Jan 14, 2025
2 parents 40f3b6f + fbeef87 commit 8c76684
Show file tree
Hide file tree
Showing 11 changed files with 154 additions and 149 deletions.
198 changes: 93 additions & 105 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = [
"cli",
"client-sdk",
"interfaces",
# "wasm",
"wasm",
"balance-prover",
"store-vault-server",
"validity-prover",
Expand Down
7 changes: 5 additions & 2 deletions interfaces/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ ark-ec = { workspace = true }
ark-bn254 = { workspace = true }
rand = "0.8.5"
num-traits = "0.2.19"
reth-ecies = { package="reth-ecies", git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
concat-kdf = "0.1.0"
sha2 = "0.10.8"
ark-ff = "0.5.0"
hmac = "0.12.1"
alloy-primitives = "0.8.18"
alloy-primitives = { version = "0.8.18", features = ["rand"] }
aes = "0.8.4"
ctr = "0.9.2"
ark-std = "0.5.0"
serde_bytes = "0.11.15"
serde_with = { version = "3.12.0", features = ["base64"] }
cfg-if = "1.0.0"

[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = "0.3"
2 changes: 1 addition & 1 deletion interfaces/src/data/encryption/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use intmax2_zkp::{
ethereum_types::{u256::U256, u32limb_trait::U32LimbTrait},
};
use rand::Rng;
use reth_ecies::ECIESError;

use super::{
errors::ECIESError,
message::EncryptedMessage,
utils::{ecdh_x, hmac_sha256, kdf, sha256, U256_SIZE},
};
Expand Down
12 changes: 12 additions & 0 deletions interfaces/src/data/encryption/errors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use thiserror::Error;

/// An error that occurs while reading or writing to an ECIES stream.
#[derive(Debug, Error)]
pub enum ECIESError {
/// Error when checking the HMAC tag against the tag on the message being decrypted
#[error("tag check failure in read_header")]
TagCheckDecryptFailed,
/// The encrypted data is not large enough for all fields
#[error("encrypted data is not large enough for all fields")]
EncryptedDataTooSmall,
}
Loading

0 comments on commit 8c76684

Please sign in to comment.