Skip to content
Merged
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: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ jobs:
run: |
rustup target add wasm32-unknown-unknown
cargo check --workspace --target wasm32-unknown-unknown

- name: Test Aleo signatures
run: cargo test --features=aleosig
11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ http-did = ["hyper", "hyper-tls", "http", "percent-encoding", "tokio"]
libsecp256k1 = ["secp256k1"] # backward compatibility
secp256k1 = ["k256", "rand", "k256/keccak256"]
secp256r1 = ["p256", "rand"]
aleosig = ["rand", "blake2", "snarkvm-dpc", "snarkvm-algorithms", "snarkvm-curves", "snarkvm-utilities", "snarkvm-parameters"]
ripemd-160 = ["ripemd160", "secp256k1"]
# TODO handle better keccak and sha
keccak = ["keccak-hash", "secp256k1", "k256/keccak256"]
Expand Down Expand Up @@ -69,6 +70,7 @@ serde_urlencoded = "0.7"
percent-encoding = { version = "2.1", optional = true }
tokio = { version = "1.0", optional = true, features = ["macros"] }
blake2b_simd = "0.5"
blake2 = { version = "0.9", optional = true }
bs58 = { version = "0.4", features = ["check"] }
thiserror = "1.0"
keccak-hash = { version = "0.7", optional = true }
Expand All @@ -85,6 +87,13 @@ flate2 = "1.0"
bitvec = "0.20"
clear_on_drop = "0.2.4"
url = { version = "2.2", features = ["serde"] }
rand_xorshift = "0.3"
bech32 = "0.8"
snarkvm-dpc = { version = "0.7.9", optional = true }
snarkvm-algorithms = { version= "0.7.9", optional = true }
snarkvm-curves = { version= "0.7.9", optional = true }
snarkvm-utilities = { version = "0.7.9", optional = true }
snarkvm-parameters = { version = "0.7.9", optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
chrono = { version = "0.4", features = ["serde"] }
Expand All @@ -109,7 +118,7 @@ members = [
]

[dev-dependencies]
blake2 = "0.8" # for bbs doctest
blake2_old = { package = "blake2", version = "0.8" } # for bbs doctest
uuid = { version = "0.8", features = ["v4", "serde"] }
difference = "2.0"
did-method-key = { path = "./did-key" }
Expand Down
76 changes: 76 additions & 0 deletions contexts/aleovm.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"AleoMethod2021": {
"@id": "https://w3id.org/security#AleoMethod2021",
"@context": {
"@protected": true,
"id": "@id",
"type": "@type",
"controller": {
"@id": "https://w3id.org/security#controller",
"@type": "@id"
},
"blockchainAccountId": "https://w3id.org/security#blockchainAccountId"
}
},
"AleoSignature2021": {
"@id": "https://w3id.org/security#AleoSignature2021",
"@context": {
"@protected": true,
"id": "@id",
"type": "@type",
"challenge": "https://w3id.org/security#challenge",
"created": {
"@id": "http://purl.org/dc/terms/created",
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
},
"domain": "https://w3id.org/security#domain",
"expires": {
"@id": "https://w3id.org/security#expiration",
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
},
"nonce": "https://w3id.org/security#nonce",
"proofPurpose": {
"@id": "https://w3id.org/security#proofPurpose",
"@type": "@vocab",
"@context": {
"@protected": true,
"id": "@id",
"type": "@type",
"assertionMethod": {
"@id": "https://w3id.org/security#assertionMethod",
"@type": "@id",
"@container": "@set"
},
"authentication": {
"@id": "https://w3id.org/security#authenticationMethod",
"@type": "@id",
"@container": "@set"
},
"capabilityInvocation": {
"@id": "https://w3id.org/security#capabilityInvocationMethod",
"@type": "@id",
"@container": "@set"
},
"capabilityDelegation": {
"@id": "https://w3id.org/security#capabilityDelegationMethod",
"@type": "@id",
"@container": "@set"
},
"keyAgreement": {
"@id": "https://w3id.org/security#keyAgreementMethod",
"@type": "@id",
"@container": "@set"
}
}
},
"proofValue": {
"@id": "https://w3id.org/security#proofValue",
"@type": "https://w3id.org/security#multibase"
},
"verificationMethod": {
"@id": "https://w3id.org/security#verificationMethod",
"@type": "@id"
}
}
}
}
1 change: 1 addition & 0 deletions contexts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ pub const TZJCSVM_V1: &str = include_str!("../tzjcsvm-2021-v1.jsonld");
pub const EIP712VM: &str = include_str!("../eip712vm.jsonld");
pub const EPSIG_V0_1: &str = include_str!("../epsig-v0.1.jsonld");
pub const SOLVM: &str = include_str!("../solvm.jsonld");
pub const ALEOVM: &str = include_str!("../aleovm.jsonld");
11 changes: 11 additions & 0 deletions examples/genaleojwk.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#[async_std::main]
#[ignore] // Skip expensive key generation
async fn main() -> Result<(), ssi::error::Error> {
#[cfg(feature = "aleosig")]
{
let jwk = ssi::jwk::JWK::generate_aleo()?;
let writer = std::io::BufWriter::new(std::io::stdout());
serde_json::to_writer_pretty(writer, &jwk).unwrap();
}
Ok(())
}
Loading