diff --git a/Cargo.lock b/Cargo.lock index 0dc2c0bf1e26d..364f94d67823a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9306,6 +9306,18 @@ dependencies = [ "sha2 0.10.8", ] +[[package]] +name = "p384" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" +dependencies = [ + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", + "primeorder", + "sha2 0.10.8", +] + [[package]] name = "pairing" version = "0.23.0" @@ -15747,6 +15759,7 @@ dependencies = [ "bincode", "byteorder", "chrono", + "ciborium", "consensus-config", "coset", "criterion", @@ -15776,6 +15789,7 @@ dependencies = [ "num_enum 0.6.1", "once_cell", "p256", + "p384", "parking_lot 0.12.1", "passkey-authenticator", "passkey-client", @@ -15785,6 +15799,7 @@ dependencies = [ "proptest-derive 0.5.1", "rand 0.8.5", "roaring", + "rustls-pemfile 2.1.2", "schemars", "serde", "serde-name", @@ -15807,6 +15822,7 @@ dependencies = [ "tracing", "typed-store-error", "url", + "x509-parser", ] [[package]] @@ -18377,6 +18393,7 @@ dependencies = [ "lazy_static", "nom", "oid-registry", + "ring 0.16.20", "rusticata-macros", "thiserror 1.0.64", "time", diff --git a/Cargo.toml b/Cargo.toml index 20f5007a09d17..48d5ddd0e5be3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -539,7 +539,7 @@ webpki = { version = "0.102", package = "rustls-webpki", features = [ "std", ] } wiremock = "0.5" -x509-parser = "0.14.0" +x509-parser = { version = "0.14.0", features = ["verify"] } zstd = "0.12.3" zeroize = "1.6.0" versions = "4.1.0" @@ -585,6 +585,9 @@ passkey-authenticator = { version = "0.2.0" } coset = "0.3" p256 = { version = "0.13.2", features = ["ecdsa"] } +p384 = { version = "0.13.0", default-features = false, features = ["ecdsa","sha384"] } +ciborium = "0.2" + # anemo dependencies anemo = { git = "https://github.com/mystenlabs/anemo.git", rev = "e609f7697ed6169bf0760882a0b6c032a57e4f3b" } anemo-build = { git = "https://github.com/mystenlabs/anemo.git", rev = "e609f7697ed6169bf0760882a0b6c032a57e4f3b" } diff --git a/crates/sui-framework/docs/sui-framework/nitro_attestation.md b/crates/sui-framework/docs/sui-framework/nitro_attestation.md new file mode 100644 index 0000000000000..196f0117d5b71 --- /dev/null +++ b/crates/sui-framework/docs/sui-framework/nitro_attestation.md @@ -0,0 +1,71 @@ +--- +title: Module `0x2::nitro_attestation` +--- + + + +- [Function `verify_nitro_attestation_internal`](#0x2_nitro_attestation_verify_nitro_attestation_internal) +- [Function `verify_nitro_attestation`](#0x2_nitro_attestation_verify_nitro_attestation) + + +
use 0x2::clock;
+
+
+
+
+
+
+## Function `verify_nitro_attestation_internal`
+
+Internal native function
+
+
+fun verify_nitro_attestation_internal(attestation: &vector<u8>, current_timestamp: u64): vector<vector<u8>>
+
+
+
+
+native fun verify_nitro_attestation_internal(
+ attestation: &vector<u8>,
+ current_timestamp: u64
+): vector<vector<u8>>;
+
+
+
+
+public fun verify_nitro_attestation(attestation: &vector<u8>, clock: &clock::Clock): vector<vector<u8>>
+
+
+
+
+public fun verify_nitro_attestation(
+ attestation: &vector<u8>,
+ clock: &Clock
+): vector<vector<u8>> {
+ verify_nitro_attestation_internal(attestation, clock::timestamp_ms(clock))
+}
+
+
+
+
+