Skip to content

Commit

Permalink
fmt and sort
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacholme7 committed Feb 18, 2025
1 parent eca2089 commit 9fcf59a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
24 changes: 12 additions & 12 deletions anchor/keygen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ edition = { workspace = true }
authors = ["Sigma Prime <[email protected]>"]

[dependencies]
clap = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
types = { workspace = true }
openssl = { workspace = true }
scrypt = "0.11.0"
sha2 = { workspace = true }
aes = "0.8.4"
alloy = { workspace = true }
base64 = { workspace = true }
bls_lagrange = { workspace = true }
chrono = { version = "0.4.39", features = ["serde"] }
clap = { workspace = true }
ctr = "0.9.2"
hex = { workspace = true }
eth-keystore = "0.5.0"
bls_lagrange = { workspace = true }
hex = { workspace = true }
openssl = { workspace = true }
rand = { workspace = true }
scrypt = "0.11.0"
serde = { workspace = true }
serde_json = { workspace = true }
sha2 = { workspace = true }
ssv_types = { workspace = true }
base64 = { workspace = true }
alloy = { workspace = true }
chrono = {version = "0.4.39", features = ["serde"]}
types = { workspace = true }
2 changes: 1 addition & 1 deletion anchor/keygen/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct Manual {
required = true,
num_args = 1..,
value_delimiter = ',')]
pub public_keys: Vec<Rsa<Public>>,
pub public_keys: Vec<Rsa<Public>>,
}

// Options that are releveant to both onchain and manual keysplitting
Expand Down
15 changes: 7 additions & 8 deletions anchor/keygen/src/crypto.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
use crate::{
keystore::Keystore,
cli::SharedKeygenOptions,
EncryptedKeyShare,
KeyShare,
KeygenError,
ValidatorKeys
cli::SharedKeygenOptions, keystore::Keystore, EncryptedKeyShare, KeyShare, KeygenError,
ValidatorKeys,
};
use aes::cipher::{InnerIvInit, KeyInit, StreamCipherCore};
use aes::Aes128;
use ctr::cipher;
use bls_lagrange::{split, KeyId};
use ctr::cipher;
use openssl::encrypt::Encrypter;
use openssl::pkey::PKey;
use scrypt::{scrypt, Params as ScryptParams};
Expand Down Expand Up @@ -64,7 +60,10 @@ pub fn extract_key(keystore: &Keystore, password: &str) -> Result<ValidatorKeys,
}

// Given a secret key, split it into parts
pub fn split_keys(shared: &SharedKeygenOptions, sk: SecretKey) -> Result<Vec<(KeyId, SecretKey)>, KeygenError> {
pub fn split_keys(
shared: &SharedKeygenOptions,
sk: SecretKey,
) -> Result<Vec<(KeyId, SecretKey)>, KeygenError> {
let num_operators = shared.operators.0.len();
let threshold = num_operators - ((num_operators - 1) / 3);

Expand Down
2 changes: 1 addition & 1 deletion anchor/keygen/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub use cli::{Keygen, KeygenSubcommands, Manual, Onchain};
use crate::crypto::{encrypt_keyshares, split_keys};
use crate::output::OutputData;
use crate::split::{manual_split, onchain_split};
pub use cli::{Keygen, KeygenSubcommands, Manual, Onchain};
use crypto::extract_key;
use error::KeygenError;
use openssl::pkey::Public;
Expand Down

0 comments on commit 9fcf59a

Please sign in to comment.