forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Ristretto version of THEMIS (solana-labs#566)
* Add Ristretto version of THEMIS BN BPF instruction counts: CalculateAggregate: 83,511 SubmitProofDecryption: 33,755,027 Ristretto BPF instruction counts: CalculateAggregate: 13,049,558 SubmitProofDecryption: 13,149,232 * Fix CI script
- Loading branch information
Showing
32 changed files
with
1,750 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
[package] | ||
name = "spl-themis-client" | ||
name = "spl-themis-bn-client" | ||
version = "0.1.0" | ||
description = "SPL THEMIS client" | ||
authors = ["Solana Maintainers <[email protected]>"] | ||
|
@@ -24,7 +24,7 @@ futures = "0.3" | |
solana-banks-client = "1.3.14" | ||
solana-cli-config = "1.3.14" | ||
solana-sdk = "1.3.14" | ||
spl-themis = { version = "0.1.0", path = "../program" } | ||
spl-themis-bn = { version = "0.1.0", path = "../program_bn" } | ||
tarpc = { version = "0.21.1", features = ["full"] } | ||
tokio = "0.2" | ||
url = "2.1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
[package] | ||
name = "spl-themis-ristretto-client" | ||
version = "0.1.0" | ||
description = "SPL THEMIS client" | ||
authors = ["Solana Maintainers <[email protected]>"] | ||
repository = "https://github.com/solana-labs/solana-program-library" | ||
license = "Apache-2.0" | ||
edition = "2018" | ||
exclude = ["js/**"] | ||
|
||
[features] | ||
no-entrypoint = [] | ||
skip-no-mangle = ["solana-sdk/skip-no-mangle"] | ||
program = ["solana-sdk/program"] | ||
default = ["solana-sdk/default"] | ||
|
||
[dependencies] | ||
bincode = "1.3" | ||
borsh = "0.7.1" | ||
curve25519-dalek = {git = "https://github.com/garious/curve25519-dalek", rev = "60efef3553d6bf3d7f3b09b5f97acd54d72529ff", default-features = false, features = ["borsh"]} | ||
elgamal_ristretto = { git = "https://github.com/garious/elgamal", rev = "260763fb67c34debe3915b39d95b6e7b3e1461d0" } | ||
futures = "0.3" | ||
solana-banks-client = "1.3.14" | ||
solana-cli-config = "1.3.14" | ||
solana-sdk = "1.3.14" | ||
spl-themis-ristretto = { version = "0.1.0", path = "../program_ristretto" } | ||
tarpc = { version = "0.21.1", features = ["full"] } | ||
tokio = "0.2" | ||
url = "2.1" | ||
|
||
[dev-dependencies] | ||
separator = "0.4.1" | ||
solana-banks-server = "1.3.14" | ||
solana-bpf-loader-program = "1.3.14" | ||
solana_rbpf = "=0.1.31" | ||
solana-runtime = "1.3.14" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "lib"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use std::{fs::canonicalize, process::Command}; | ||
|
||
fn main() { | ||
println!("cargo:warning=(not a warning) Building SPL Themis shared object"); | ||
Command::new(canonicalize("../../do.sh").unwrap()) | ||
.current_dir("../..") | ||
.arg("build") | ||
.arg("themis/program_ristretto") | ||
.status() | ||
.expect("Failed to build themis program") | ||
.success(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//! Themis client | ||
use solana_banks_client::start_tcp_client; | ||
use solana_cli_config::{Config, CONFIG_FILE}; | ||
use solana_sdk::signature::read_keypair_file; | ||
use spl_themis_ristretto_client::test_e2e; | ||
use std::path::Path; | ||
use tokio::runtime::Runtime; | ||
use url::Url; | ||
|
||
fn main() { | ||
let config_file = CONFIG_FILE.as_ref().unwrap(); | ||
let config = if Path::new(&config_file).exists() { | ||
Config::load(&config_file).unwrap() | ||
} else { | ||
Config::default() | ||
}; | ||
let rpc_banks_url = Config::compute_rpc_banks_url(&config.json_rpc_url); | ||
let url = Url::parse(&rpc_banks_url).unwrap(); | ||
let host_port = (url.host_str().unwrap(), url.port().unwrap()); | ||
|
||
Runtime::new().unwrap().block_on(async { | ||
let mut banks_client = start_tcp_client(host_port).await.unwrap(); | ||
let policies = vec![1u64.into(), 2u64.into()]; | ||
let sender_keypair = read_keypair_file(&config.keypair_path).unwrap(); | ||
test_e2e( | ||
&mut banks_client, | ||
sender_keypair, | ||
policies, | ||
1_000, | ||
3u64.into(), | ||
) | ||
.await | ||
.unwrap(); | ||
}); | ||
} |
Oops, something went wrong.