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

Compiler v2 #6

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
11b24bb
[compiler-v2] add aptos crypto libraries
welbon Sep 9, 2024
eb119ca
[compiler-v2] add aptos crypto libraries
welbon Sep 9, 2024
0a0f30b
[compiler-v2] add aptos crypto libraries
welbon Sep 9, 2024
8cea51a
fix compile
nkysg Sep 9, 2024
ebabdf4
[compiler-v2] add aptos crypto libraries
welbon Sep 9, 2024
7f41318
[compiler-v2] Fixed compiler error
welbon Sep 9, 2024
a7e0740
[compiler-v2] declare package name to lib
welbon Sep 9, 2024
b0d95f6
[compiler-v2] export CryptoHasher
welbon Sep 10, 2024
acf1e65
[compiler-v2] export aptos_crypto::hash
welbon Sep 10, 2024
e1f350a
[compiler-v2] remove aptos-crytpo hash for debug
welbon Sep 10, 2024
4cb6458
[compiler-v2] add aptos-crytpo hash DummyHasher, CryptoHasher for debug
welbon Sep 10, 2024
0f12f1e
[compiler-v2] add aptos-cryto to compile-v2 module for debug
welbon Sep 10, 2024
b0556b3
[compiler-v2] add aptos-cryto to compile-v2 module for debug
welbon Sep 10, 2024
fd7322b
[compiler-v2] fixed some project error
welbon Sep 10, 2024
fe66294
[compiler-v2] fixed all errors
welbon Sep 11, 2024
0970efe
[compiler-v2] fixed crypto hasher macro derive
welbon Sep 11, 2024
48d79ec
[compiler-v2] fixed crypto hasher macro derive
welbon Sep 11, 2024
9fae41d
[compiler-v2] fixed crypto hasher macro derive
welbon Sep 11, 2024
257ed3c
[compiler-v2] fixed crypto hasher macro derive
welbon Sep 11, 2024
d593443
[compiler-v2] fixed crypto hasher macro derive
welbon Sep 11, 2024
00a04ba
[compiler-v2] add JSONSchema
welbon Sep 11, 2024
95a42b4
[compiler-v2] fixed compiler error for tiny-keccak select 'sha3'
welbon Sep 11, 2024
cce8225
Fix compiler
sanlee42 Sep 11, 2024
d3c5100
[compiler-v2] fixed compiler error for DummyHasher
welbon Sep 11, 2024
2e8b552
re-export some crates and constants (#7)
simonjiao Sep 24, 2024
5ab5176
fix ed25519 fuzzing (#8)
nkysg Sep 28, 2024
e5e9057
add HashValue::from_hex_literal (#9)
nkysg Oct 6, 2024
ca832cc
HashValue supoort from<u64> && as_ref<u8> (#10)
nkysg Oct 9, 2024
17607ac
update openrpc-schema (#11)
nkysg Nov 1, 2024
69ccde1
fix HashValue break serde (#12)
nkysg Nov 22, 2024
a14be64
Fix HashValue serde json (#13)
nkysg Nov 22, 2024
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
2,265 changes: 1,847 additions & 418 deletions Cargo.lock

Large diffs are not rendered by default.

82 changes: 81 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,99 @@
[workspace]
resolver = "2"

members = [
"crates/diem-crypto",
"crates/aptos-crypto",
"crates/aptos-crypto-derive",
"crypto",
"crypto/crypto-macro",
]

default-members = [
"crates/aptos-crypto",
"crates/aptos-crypto-derive",
"crypto",
"crypto/crypto-macro",
]

[workspace.dependencies]
aes-gcm = "0.10.3"
anyhow = "1.0.71"
ark-bn254 = "0.4.0"
ark-bls12-381 = "0.4.0"
ark-ec = "0.4.0"
ark-ff = "0.4.0"
ark-groth16 = "0.4.0"
ark-serialize = "0.4.0"
ark-std = { version = "0.4.0", features = ["getrandom"] }
base64 = "0.13.0"
bcs = { git = "https://github.com/aptos-labs/bcs.git", rev = "d31fab9d81748e2594be5cd5cdf845786a30562d" }
blake2 = "0.10.4"
blst = "0.3.11"
blake2-rfc = "0.2.18"
bulletproofs = { version = "4.0.0" }
bytes = { version = "1.4.0", features = ["serde"] }
byteorder = "1.4.3"
bitvec = "1.0.1"
criterion = "0.3.5"
curve25519-dalek = "3"
curve25519-dalek-ng = "4"
digest = "0.9.0"
ed25519-dalek = { version = "1.0.1", features = ["std", "serde"] }
ff = { version = "0.13", features = ["derive"] }
hex = { version = "0.4.3", features = ["serde"] }
hkdf = "0.10.0"
libsecp256k1 = "0.7.0"
merlin = "3"
more-asserts = "0.3.0"
neptune = { version = "13.0.0", default_features = false }
num-bigint = { version = "0.3.2", features = ["rand"] }
num-integer = "0.1.42"
once_cell = "1.10.0"
openrpc-schema = {git = "https://github.com/starcoinorg/openrpc-rs",rev = "f8ab047e30927cdf2f605b61a219c975d6c4f666"}
p256 = { version = "0.13.2" }
poseidon-ark = { git = "https://github.com/arnaucube/poseidon-ark.git", rev = "6d2487aa1308d9d3860a2b724c485d73095c1c68" }
proc-macro2 = "1.0.18"
proptest = "1.4.0"
proptest-derive = "0.4.0"
quote = "1.0.6"
rand = "0.7.3"
rand_core = "0.5.1"
ring = { version = "0.16.20", features = ["std"] }
serde = "1.0.193"
serde_json = { version = "1.0.81", features = [
"preserve_order",
"arbitrary_precision",
] } # Note: arbitrary_precision is required to parse u256 in JSON
trybuild = "1.0.80"
serde-name = "0.1.1"
serde_bytes = "0.11.6"
sha2 = "0.9.3"
sha2_0_10_6 = { package = "sha2", version = "0.10.6" }
sha3 = "0.9.1"
signature = "2.1.0"
static_assertions = "1.1.0"
thiserror = "1.0.37"
tiny-keccak = { version = "2.0.2", features = ["sha3"] }
typenum = "1.17.0"
x25519-dalek = "1.2.0"
starcoin-crypto = { path = "crypto" }
starcoin-crypto-macro = { path = "crypto/crypto-macro"}
aptos-crypto = { path = "crates/aptos-crypto" }
aptos-crypto-derive = { path = "crates/aptos-crypto-derive" }
diem-crypto = { package="diem-crypto", path = "crates/diem-crypto", features = ["fuzzing"] }
diem-crypto-derive = { package="diem-crypto-derive", path = "crates/diem-crypto-derive" }
syn = { version = "1.0.30", features = ["derive"] }


[profile.dev]
panic = "unwind"

[profile.release]
debug = false
panic = "unwind"
debug-assertions = false
codegen-units = 1
codegen-units = 1

[patch.crates-io]
x25519-dalek = { git = "https://github.com/aptos-labs/x25519-dalek", branch = "zeroize_v1" }
24 changes: 24 additions & 0 deletions crates/aptos-crypto-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "aptos-crypto-derive"
description = "Custom derives for `aptos-crypto`"
version = "0.0.3"

authors = ["Aptos Labs <[email protected]>"]
edition = "2021"
homepage = "https://aptoslabs.com"
license = "Apache-2.0"
publish = false
repository = "https://github.com/aptos-labs/aptos-core"
rust-version = "1.75.0"


[lib]
proc-macro = true

[dependencies]
proc-macro2 = "1.0.38"
quote = "1.0.18"
syn = { version = "1.0.92", features = ["derive", "extra-traits"] }

[dev-dependencies]
anyhow = "1.0.71"
21 changes: 21 additions & 0 deletions crates/aptos-crypto-derive/src/hasher.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright © Aptos Foundation
// Parts of the project are originally copyright © Meta Platforms, Inc.
// SPDX-License-Identifier: Apache-2.0

/// Converts a camel-case string to snake-case
pub fn camel_to_snake(text: &str) -> String {
let mut out = String::with_capacity(text.len());
let mut first = true;
text.chars().for_each(|c| {
if !first && c.is_uppercase() {
out.push('_');
out.extend(c.to_lowercase());
} else if first {
first = false;
out.extend(c.to_lowercase());
} else {
out.push(c);
}
});
out
}
Loading