diff --git a/Cargo.lock b/Cargo.lock index c0b7d7148..447824410 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1335,6 +1335,7 @@ dependencies = [ "fastcrypto-derive", "faster-hex", "generic-array", + "getrandom", "hex", "hex-literal", "hkdf", @@ -1631,8 +1632,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if 1.0.0", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] diff --git a/fastcrypto/Cargo.toml b/fastcrypto/Cargo.toml index 7f146e1b3..cb6c9e7b7 100644 --- a/fastcrypto/Cargo.toml +++ b/fastcrypto/Cargo.toml @@ -53,6 +53,7 @@ fastcrypto-derive = { path = "../fastcrypto-derive", version = "0.1.3" } serde_json = "1.0.93" num-bigint = "0.4.4" bech32 = "0.9.1" +getrandom = {version = "0.2.15", features = ["js"], optional = true} # Required for bulletproofs bulletproofs = { version = "4.0.0", optional = true } @@ -114,6 +115,9 @@ experimental = ["dep:bulletproofs", "dep:merlin"] # Include AES and its modes. aes = ["dep:aes", "dep:cbc", "dep:aes-gcm", "dep:ctr", "dep:aes-gcm-siv"] +# Needs to be enabled for wasm targets. +wasm = ["dep:getrandom"] + [dev-dependencies] criterion = "0.4.0" k256 = { version = "0.11.6", features = ["ecdsa", "sha256", "keccak256"] }