This repository provides functionality for verifying ECDSA signature and AES ciphertext against attestations generated by Primus.
For ECDSA signature, the underlying elliptic curve is Secp256k1. AES ciphertext is produced using AES-128-GCM.
Compile in release mode:
cargo build --releaseThe example verification_example.rs demonstrates how to verify an AES ciphertext.
Build and run the example as follows:
cargo build --release --example verification_example
./target/release/examples/verification_exampleTwo other examples are provided: attestation_example.rs and partial_attestation_example.rs.
They demonstrate how to verify attestations generated by Primus, including the ECDSA signature, AES ciphertext, and the data source URL of the attestation.
Build and run them as follows:
cargo build --release --example attestation_example
./target/release/examples/attestation_exampleor
cargo build --release --example partial_attestation_example
./target/release/examples/partial_attestation_exampleNote:
attestation_exampletakes the full JSON ciphertext as input.
partial_attestation_examplesimilar toattestation_example, but takes a trimmed JSON ciphertext (containing only the fields required for computation) as input, which is more computationally efficient.
The benchmark file is located in bench.
Build and run the benchmark as follows:
cargo bench --bench benchmark