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

[ON HOLD] wip: Reference implementation of message encryption #1127

Draft
wants to merge 3 commits into
base: feature/transaction-messages
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion radix-engine-common/src/crypto/public_key_ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use sbor::rust::prelude::*;
use sbor::*;
use utils::copy_u8_array;

/// Represents an ED25519 public key.
/// Represents an Ed25519 public key.
/// In particular, wraps the 32-byte CompressedEdwardsY representation.
#[cfg_attr(feature = "radix_engine_fuzzing", derive(Arbitrary))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Sbor)]
Expand Down
2 changes: 1 addition & 1 deletion simulator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ radix-engine-stores = { path = "../radix-engine-stores", features = ["rocksdb"]
radix-engine-queries = { path = "../radix-engine-queries" }
radix-engine-constants = { path = "../radix-engine-constants" }
radix-engine-interface = { path = "../radix-engine-interface" }
transaction = { path = "../transaction" }
transaction = { path = "../transaction", default-features = false, features = ["std"] }
utils = { path = "../utils" }
serde = { version = "1.0.137", features = ["derive"] }
serde_json = { version = "1.0.81" }
Expand Down
12 changes: 11 additions & 1 deletion transaction/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,26 @@ lazy_static = "1.4.0"
strum = { version = "0.24.1", default-features = false, features = ["derive"], optional = true }
strum_macros = { version = "0.24.3", default-features = false, optional = true }

# For message encryption
hkdf = { version = "0.12.3", default-features = false, optional = true }
hmac = { version = "0.12.1", default-features = false, optional = true }
aes-gcm = { version = "0.10.2", default-features = false, features = ["aes", "alloc", "getrandom"], optional = true }
x25519-dalek = { version = "1.2.0", default-features = false, features = ["u64_backend", "reusable_secrets"], optional = true }
curve25519-dalek = { version = "3.2.1", default-features = false, features = ["u64_backend"], optional = true }
rand_core = { version = "0.5", default-features = false, optional = true }
aes-kw = { version = "0.2.1", default-features = false, optional = true }

[dev-dependencies]
scrypto = { path = "../scrypto" }
scrypto-derive = { path = "../scrypto-derive" }

[features]
# You should enable either `std` or `alloc`
default = ["std"]
default = ["std", "message_encryption"]
std = ["sbor/std", "utils/std", "radix-engine-interface/std", "radix-engine-common/std", "hex/std", "ed25519-dalek/std", "secp256k1/std"]
alloc = ["sbor/alloc", "utils/alloc", "radix-engine-interface/alloc", "radix-engine-common/alloc", "hex/alloc", "ed25519-dalek/alloc", "secp256k1/alloc", "lazy_static/spin_no_std"]
serde = ["serde/derive"]
message_encryption = ["hkdf", "hmac", "aes-gcm", "x25519-dalek", "curve25519-dalek", "rand_core", "aes-kw"]

dump_manifest_to_file = []

Expand Down
2 changes: 2 additions & 0 deletions transaction/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ pub mod builder;
pub mod data;
pub mod errors;
pub mod manifest;
#[cfg(feature = "message_encryption")]
pub mod message;
pub mod model;
pub mod signing;
pub mod validation;
Expand Down
Loading