From a830140f00fee00373bd51bfa5566fea9224df4f Mon Sep 17 00:00:00 2001 From: psykose Date: Wed, 27 Apr 2022 03:57:56 +0000 Subject: [PATCH] wireguard-vanity-address: upgrade 0.4.0_git20200327 more features less bugs --- ...0001-add-curve25519-dalek-dependency.patch | 37 + ...orithm-point-addition-not-scalarmult.patch | 558 +++++++++ ...0003-update-benchmarks-to-new-scheme.patch | 113 ++ .../0004-lowercase-lol.patch | 24 + wireguard-vanity-address/0005-sync-deps.patch | 1096 +++++++++++++++++ wireguard-vanity-address/APKBUILD | 22 +- wireguard-vanity-address/more-features.patch | 122 -- 7 files changed, 1844 insertions(+), 128 deletions(-) create mode 100644 wireguard-vanity-address/0001-add-curve25519-dalek-dependency.patch create mode 100644 wireguard-vanity-address/0002-new-search-algorithm-point-addition-not-scalarmult.patch create mode 100644 wireguard-vanity-address/0003-update-benchmarks-to-new-scheme.patch create mode 100644 wireguard-vanity-address/0004-lowercase-lol.patch create mode 100644 wireguard-vanity-address/0005-sync-deps.patch delete mode 100644 wireguard-vanity-address/more-features.patch diff --git a/wireguard-vanity-address/0001-add-curve25519-dalek-dependency.patch b/wireguard-vanity-address/0001-add-curve25519-dalek-dependency.patch new file mode 100644 index 0000000..c714353 --- /dev/null +++ b/wireguard-vanity-address/0001-add-curve25519-dalek-dependency.patch @@ -0,0 +1,37 @@ +From 7780dadbb7d78994bd8bf1a64c4f2e60ecf569b3 Mon Sep 17 00:00:00 2001 +From: Brian Warner +Date: Tue, 3 Mar 2020 21:11:17 -0800 +Subject: [PATCH 1/5] add curve25519-dalek dependency + +--- + Cargo.lock | 1 + + Cargo.toml | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/Cargo.lock b/Cargo.lock +index 2f76cdc..938baf8 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -624,6 +624,7 @@ dependencies = [ + "base64 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "curve25519-dalek 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +diff --git a/Cargo.toml b/Cargo.toml +index 85a6c37..696c44e 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -24,6 +24,7 @@ rayon = "1.0" + base64 = "0.12" + rand_core = { version = "0.5", default-features = false, features = ["getrandom"] } + x25519-dalek = "0.6" ++curve25519-dalek = "2.0" + num_cpus = "1.0" + + [dev-dependencies] +-- +2.36.0 + diff --git a/wireguard-vanity-address/0002-new-search-algorithm-point-addition-not-scalarmult.patch b/wireguard-vanity-address/0002-new-search-algorithm-point-addition-not-scalarmult.patch new file mode 100644 index 0000000..d027541 --- /dev/null +++ b/wireguard-vanity-address/0002-new-search-algorithm-point-addition-not-scalarmult.patch @@ -0,0 +1,558 @@ +From 1f7a1caa5c7cf274bdc255e480b925e521cf0a66 Mon Sep 17 00:00:00 2001 +From: Brian Warner +Date: Tue, 3 Mar 2020 21:11:54 -0800 +Subject: [PATCH 2/5] new search algorithm: point addition, not scalarmult + +The basic operation used to take 17us/iter on my 2019 mac mini (3.2GHz Core +i7). The new approach takes 3.8us/iter. + +refs #12 +--- + src/bin.rs | 56 +++---- + src/lib.rs | 429 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 447 insertions(+), 38 deletions(-) + +diff --git a/src/bin.rs b/src/bin.rs +index a5a6f35..4d3f736 100644 +--- a/src/bin.rs ++++ b/src/bin.rs +@@ -1,27 +1,12 @@ + use std::error::Error; + use std::fmt; + use std::io::{self, Write}; +-use std::time::{Duration, SystemTime}; + + use clap::{App, AppSettings, Arg}; + use num_cpus; + use rayon::prelude::*; +-use wireguard_vanity_lib::trial; +- +-fn estimate_one_trial() -> Duration { +- let prefix = "prefix"; +- let start = SystemTime::now(); +- const COUNT: u32 = 100; +- (0..COUNT).for_each(|_| { +- trial(&prefix, 0, 10); +- }); +- let elapsed = start.elapsed().unwrap(); +- elapsed.checked_div(COUNT).unwrap() +-} +- +-fn duration_to_f64(d: Duration) -> f64 { +- (d.as_secs() as f64) + (f64::from(d.subsec_nanos()) * 1e-9) +-} ++use wireguard_vanity_lib::{measure_rate, search_for_prefix}; ++use x25519_dalek::{PublicKey, StaticSecret}; + + fn format_time(t: f64) -> String { + if t > 3600.0 { +@@ -61,8 +46,11 @@ fn format_rate(rate: f64) -> String { + } + } + +-fn print(res: (String, String)) -> Result<(), io::Error> { +- let (private_b64, public_b64) = res; ++fn print(res: (StaticSecret, PublicKey)) -> Result<(), io::Error> { ++ let private: StaticSecret = res.0; ++ let public: PublicKey = res.1; ++ let private_b64 = base64::encode(&private.to_bytes()); ++ let public_b64 = base64::encode(public.as_bytes()); + writeln!( + io::stdout(), + "private {} public {}", +@@ -131,29 +119,22 @@ fn main() -> Result<(), Box> { + &prefix, end, trials_per_key + ); + +- // todo: dividing by num_cpus will overestimate performance when the +- // cores aren't actually distinct (hyperthreading?). My Core-i7 seems to +- // run at half the speed that this predicts. ++ // get_physical() appears to be more accurate: hyperthreading doesn't ++ // help us much + + if trials_per_key < 2u64.pow(32) { +- let est = estimate_one_trial(); ++ let raw_rate = measure_rate(); + println!( +- "one trial takes {}, CPU cores available: {}", +- format_time(duration_to_f64(est)), +- num_cpus::get() ++ "one core runs at {}, CPU cores available: {}", ++ format_rate(raw_rate), ++ num_cpus::get_physical(), + ); +- let spk = duration_to_f64( +- est // sec/trial on one core +- .checked_div(num_cpus::get() as u32) // sec/trial with all cores +- .unwrap() +- .checked_mul(trials_per_key as u32) // sec/key (Duration) +- .unwrap(), +- ); +- let kps = 1.0 / spk; ++ let total_rate = raw_rate * (num_cpus::get_physical() as f64) / (trials_per_key as f64); ++ let seconds_per_key = 1.0 / total_rate; + println!( + "est yield: {} per key, {}", +- format_time(spk), +- format_rate(kps) ++ format_time(seconds_per_key), ++ format_rate(total_rate) + ); + } + +@@ -162,8 +143,7 @@ fn main() -> Result<(), Box> { + // 1M trials takes about 10s on my laptop, so let it run for 1000s + (0..100_000_000) + .into_par_iter() +- .map(|_| trial(&prefix, 0, end)) +- .filter_map(|r| r) ++ .map(|_| search_for_prefix(&prefix, 0, end)) + .try_for_each(print)?; + Ok(()) + } +diff --git a/src/lib.rs b/src/lib.rs +index 31138c5..2e6b33f 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -1,5 +1,7 @@ + use base64; ++use curve25519_dalek::{constants::ED25519_BASEPOINT_POINT, edwards::EdwardsPoint, scalar::Scalar}; + use rand_core::OsRng; ++use std::time::{Duration, Instant}; + use x25519_dalek::{PublicKey, StaticSecret}; + + pub fn trial(prefix: &str, start: usize, end: usize) -> Option<(String, String)> { +@@ -16,3 +18,430 @@ pub fn trial(prefix: &str, start: usize, end: usize) -> Option<(String, String)> + None + } + } ++ ++// To perform a fast search, our basic algorithm is: ++// loop { ++// let base_privkey = new random scalar; ++// let add_privkey = 8; ++// let add_pubkey = scalarmult(8); ++// ++// let mut offset = 0; ++// let mut trial_pubkey = scalarmult(base_privkey); ++// while !encoding(trial_pubkey).meets_target() { ++// offset += add_privkey ++// trial_pubkey += add_pubkey ++// } ++// privkey = base_privkey + offset ++// yield (privkey, trial_pubkey) ++// } ++ ++// We reset to a new random base_privkey after each matching keypair, ++// otherwise someone who learns one privkey can easily find the others. ++// We offset by 8 to make sure that each new privkey will meet the same ++// clamping criteria: we assume the keyspace is large enough that we're ++// unlikely to wrap around. ++ ++// To implement this in curve25519, we have to dance around two different ++// representations of scalars. ++ ++// x25519 private keys are scalars in the large prime-order subgroup of ++// the points on Curve25519. The order of this subgroup is named "l", ++// which is a number somewhat larger than 2^252. For convenience later, ++// we'll define this number as "big+small", where big=2^252 and small is ++// the remainder ("small" is a bit larger than 2^128). The hex ++// representation of "small" ends in 0xD3ED, so "l"%8 is 5. ++ ++// The x25519-dalek implementation (StaticSecret or EphemeralSecret) ++// represents these as 256-bit integers with 5 bits "clamped" in various ++// ways: the high-order two bits are set to 0b01, and the low-order three ++// bits are set to 0b000. Therefore the integers "s" are in the range ++// 2^254 to 2^255-1, and s%8==0. These "clamped" keys can represent ++// slightly fewer than half of the possible private keys (2^251 out of ++// "l"). ++ ++// Why clamp? The 2^255 bit is cleared to make sure that "add" won't ++// overflow a 256-bit container. The 2^254 bit is set for the sake of an ++// unwise montgomery ladder implementation whose runtime reveals the ++// number of leading zero bits: all private keys have the same such ++// number (one), thus the attacker doesn't learn anything new. The low ++// three bits are clamped for the sake of an unwise/faster verifier which ++// doesn't check that the received point is a member of the right group, ++// enabling a small-subgroup attack that reveals the private key mod 8 ++// (the curve group's cofactor). By setting those bits to a fixed value, ++// the attacker has nothing to learn. (I'm not exactly sure what they ++// *do* learn: I suspect it's ((p%l)%8), and the fact that (p%8)==0 ++// doesn't necessarily mean that ((p%l)%8) is a fixed number: they might ++// learn the top three bits of p instead). ++ ++// Curve25519::Scalar values don't do much clamping, but *are* always ++// reduced mod "l". Three constructors ("from_bytes_mod_order", ++// "from_bytes_mod_order_wide", and "from_canonical_bytes") can only ++// produce reduced scalars. The remaining one ("from_bits") can produce ++// non-reduced scalars: the high bit is still cleared to make sure that ++// "add" won't overflow, but the other bits are left alone. However the ++// "add" method (and others) always reduce modulo "l" before returning a ++// result, so it's not possible to keep things unreduced for very long. ++ ++// Converting from an x25519-dalek StaticSecret representation to a ++// curve25519-dalek Scalar is easy: ++// Scalar::from_bytes_mod_order(ss.to_bytes()). But how can we map in the ++// opposite direction? When we call StaticSecret::from_bits(), it's going ++// to clamp both ends, and if that clamping actually changes any bits, ++// the numerical value of the private key will be wrong. So we must ++// ensure that both ends are pre-clamped before handing it over. ++ ++// Since "l" is about 2^252, and a StaticSecret holds 255 bits, each ++// Scalar "s" (in the range 0.."l") has roughly 8 aliases: eight ++// different 255-bit numbers which are equivalent (mod "l"), whose values ++// are s+kl (k=0..7). The four high-order bits of a reduced scalar are ++// usually 0b0000. With vanishingly small probability ("small"/"l", ~= ++// 2^-124), the scalar might be larger than 2^252, but we can effectively ++// ignore this. The aliases (with high probability) have distinct ++// high-order bits: 0b0001, 0b0010, etc. We want one of the four aliases ++// whose high-order bits are 0b01xx: these bits will survive the high-end ++// clamping unchanged. These are where k=[4..7]. ++ ++// The three low-order bits will be some number N. Each alias adds l%8 to ++// this low end. So the first alias (k=1) will end in N+5, the second ++// (k=2) will end in N+2 (since (5+5)%8 == 2). Our k=4..7 yields ++// N+4,N+1,N+6,N+3. One of these values might be all zeros. That alias ++// will survive the low-end clamping unchanged. ++ ++// We can't use Scalars to add "l" and produce the aliases: any addition ++// we do on the Scalar will be reduced immediately. But we can add ++// "small", and then manually adjust the high-end byte, to produce an ++// array of bytes whose value is s+kl, and hand it over to ++// StaticSecret::from(bytes) to get an x25519 private key. The private ++// key will be in the same equivalence class as our original Scalar, but ++// its binary representation will be different. ++ ++// This conversion from Scalar to clamping-compatible bytes is the last ++// thing we do, both to emit a wireguard-suitable private key string, and ++// to double-check that our keypair actually works. We also do this ++// conversion at the very beginning, to make sure that the random ++// starting point is actually going to work. ++ ++// the resulting algorithm is: ++// loop { ++// let x = StaticSecret::new(&mut OsRng); ++// let base_scalar = Scalar::from_bytes_mod_order(x.to_bytes()); ++// if x.to_bytes() != convert(base_scalar) { break; } // try again ++// let add_privkey = Scalar::from_bytes_mod_order(to_array(8)); ++// let add_pubkey = add_privkey * ED25519_BASEPOINT_POINT; ++// ++// let mut current_offset = Scalar::from_bytes_mod_order(to_array(0)); ++// let mut trial_pubkey = base_scalar * ED25519_BASEPOINT_POINT; ++// while !encoding(trial_pubkey).meets_target() { ++// current_offset += add_privkey; ++// trial_pubkey += add_pubkey; ++// } ++// privkey = convert(base_scalar + offset) ++// yield (privkey, trial_pubkey) ++// } ++ ++// where encoding() converts to Montgomery form, then to bytes, then to ++// base64, then applies the vanity prefix check ++ ++fn add_big(input: [u8; 32], multiple: usize) -> [u8; 32] { ++ let mut out = input; ++ for _ in 0..multiple { ++ out[31] += 0b0001_0000; ++ } ++ out ++} ++ ++fn survives_clamping(input: &[u8; 32]) -> bool { ++ *input == StaticSecret::from(*input).to_bytes() ++} ++ ++fn print_bytes(name: &str, b: &[u8; 32]) { ++ println!("{} 0x{:02x} {:?} 0x{:02x}", name, b[0], b, b[31]); ++} ++ ++fn congruent_to(s: Scalar, b: &[u8; 32]) -> bool { ++ let s2 = Scalar::from_bytes_mod_order(*b); ++ s == s2 ++} ++ ++#[cfg(off)] ++fn display_scalar(s: Scalar) -> String { ++ let mut st = String::new(); ++ for b in s.to_bytes().iter().rev() { ++ st.push_str(format!("{:02x}", b).as_str()); ++ } ++ st ++} ++ ++fn convert_scalar_to_privkey(s: Scalar) -> StaticSecret { ++ // L: 0x1000000000000000000000000000000014DEF9DEA2F79CD65812631A5CF5D3ED ++ // big: 0x1000000000000000000000000000000000000000000000000000000000000000 ++ // small: 0x0000000000000000000000000000000014DEF9DEA2F79CD65812631A5CF5D3ED ++ ++ let zero = Scalar::from_bytes_mod_order([0u8; 32]); ++ let mut big_bytes = [0u8; 32]; ++ big_bytes[31] = 0b0001_0000; ++ let big = Scalar::from_bytes_mod_order(big_bytes); ++ let small: Scalar = zero - big; ++ //println!("small: {}", display_scalar(small)); ++ ++ let alias4_small = s + small + small + small + small; ++ let alias4_bytes = add_big(alias4_small.to_bytes(), 4); ++ ++ let alias5_small = alias4_small + small; ++ let alias5_bytes = add_big(alias5_small.to_bytes(), 5); ++ ++ let alias6_small = alias5_small + small; ++ let alias6_bytes = add_big(alias6_small.to_bytes(), 6); ++ ++ let alias7_small = alias6_small + small; ++ let alias7_bytes = add_big(alias7_small.to_bytes(), 7); ++ ++ if false { ++ print_bytes("orig s", &s.to_bytes()); ++ print_bytes("alias4", &alias4_bytes); ++ print_bytes("alias5", &alias5_bytes); ++ print_bytes("alias6", &alias6_bytes); ++ print_bytes("alias7", &alias7_bytes); ++ ++ println!( ++ "alias4 {} {}", ++ survives_clamping(&alias4_bytes), ++ congruent_to(s, &alias4_bytes) ++ ); ++ println!( ++ "alias5 {} {}", ++ survives_clamping(&alias5_bytes), ++ congruent_to(s, &alias5_bytes) ++ ); ++ println!( ++ "alias6 {} {}", ++ survives_clamping(&alias6_bytes), ++ congruent_to(s, &alias6_bytes) ++ ); ++ println!( ++ "alias7 {} {}", ++ survives_clamping(&alias7_bytes), ++ congruent_to(s, &alias7_bytes) ++ ); ++ } ++ ++ // this panics rather than returning an Option because we should ++ // always be starting from a well-behaved scalar, and should never ++ // get into the situation where we can't convert it ++ let alias_bytes = match s.to_bytes()[0] & 0b0111 { ++ 4 => alias4_bytes, ++ 7 => alias5_bytes, ++ 2 => alias6_bytes, ++ 5 => alias7_bytes, ++ _ => panic!("unable to convert scalar"), ++ }; ++ let privkey = StaticSecret::from(alias_bytes); ++ assert_eq!(alias_bytes, privkey.to_bytes()); ++ privkey ++} ++ ++fn integer_to_scalar(int: u64) -> Scalar { ++ let bytes = int.to_le_bytes(); ++ let mut scalar_bytes = [0u8; 32]; ++ scalar_bytes[..8].clone_from_slice(&bytes[..8]); ++ Scalar::from_bytes_mod_order(scalar_bytes) ++} ++ ++pub struct Seed { ++ base_scalar: Scalar, ++} ++ ++pub struct Scan { ++ add_count: u64, ++ add_pubkey: EdwardsPoint, ++ count: u64, ++ current_pubkey: EdwardsPoint, ++} ++ ++pub struct ScanProgress { ++ add_count: u64, ++ add_pubkey: EdwardsPoint, ++ count: u64, ++ current_pubkey: EdwardsPoint, ++ update_interval: Duration, ++ last_update: Instant, ++ last_count: u64, ++} ++ ++impl Seed { ++ pub fn generate() -> Seed { ++ let x = StaticSecret::new(&mut OsRng); ++ let base_scalar = Scalar::from_bytes_mod_order(x.to_bytes()); ++ if x.to_bytes() != convert_scalar_to_privkey(base_scalar).to_bytes() { ++ panic!("shouldn't happen"); ++ // but if for some reason we can't avoid it, we could just re-roll ++ // return None; ++ } ++ Seed { base_scalar } ++ } ++ ++ /// Returns an iterator that yields (count, points). The point can be ++ /// converted into a public key (and filtered for suitability). The count ++ /// can be combined with the base scalar and converted into the ++ /// corresponding private key. ++ pub fn scan(&self) -> Scan { ++ Scan { ++ add_count: 8, ++ add_pubkey: integer_to_scalar(8) * ED25519_BASEPOINT_POINT, ++ count: 0, ++ current_pubkey: self.base_scalar * ED25519_BASEPOINT_POINT, ++ } ++ } ++ ++ pub fn scan_progress(&self) -> ScanProgress { ++ ScanProgress { ++ add_count: 8, ++ add_pubkey: integer_to_scalar(8) * ED25519_BASEPOINT_POINT, ++ count: 0, ++ current_pubkey: self.base_scalar * ED25519_BASEPOINT_POINT, ++ update_interval: Duration::new(1, 0), ++ last_update: Instant::now(), ++ last_count: 0, ++ } ++ } ++ ++ pub fn convert_count_to_privkey(&self, count: u64) -> StaticSecret { ++ let winning_scalar = self.base_scalar + integer_to_scalar(count); ++ convert_scalar_to_privkey(winning_scalar) ++ } ++ ++ pub fn convert_both(&self, both: (u64, EdwardsPoint)) -> (StaticSecret, PublicKey) { ++ let (count, point) = both; ++ let privkey = self.convert_count_to_privkey(count); ++ let pubkey_bytes = point.to_montgomery().to_bytes(); ++ let pubkey = PublicKey::from(pubkey_bytes); ++ assert_eq!(PublicKey::from(&privkey).as_bytes(), pubkey.as_bytes()); ++ (privkey, pubkey) ++ } ++} ++ ++impl Iterator for Scan { ++ type Item = (u64, EdwardsPoint); ++ fn next(&mut self) -> Option<(u64, EdwardsPoint)> { ++ // We try up to 2^64/8 steps from each starting Seed. At roughly ++ // 4us/step, this will take ~250k years to wrap. So this check could ++ // arguably be removed. ++ if self.count >= 0xffff_ffff_ffff_fff0 { ++ return None; ++ } ++ self.count += self.add_count; ++ self.current_pubkey += self.add_pubkey; ++ Some((self.count, self.current_pubkey)) ++ } ++} ++ ++pub enum ScanResults { ++ Trial(u64, EdwardsPoint), ++ Progress(u64, f64), // total trials, total seconds ++} ++ ++impl ScanResults { ++ fn get_rate(&self) -> Option { ++ match self { ++ ScanResults::Progress(trials, seconds) => Some((*trials as f64) / *seconds), ++ _ => None, ++ } ++ } ++} ++ ++impl Iterator for ScanProgress { ++ type Item = ScanResults; ++ fn next(&mut self) -> Option { ++ use ScanResults::*; ++ if self.count & 1024 == 0 { ++ let now = Instant::now(); ++ let elapsed = now.duration_since(self.last_update); ++ if elapsed > self.update_interval { ++ let counted = self.count - self.last_count; ++ self.last_count = self.count; ++ self.last_update = now; ++ return Some(Progress(counted, elapsed.as_secs_f64())); ++ } ++ } ++ // We try up to 2^64/8 steps from each starting Seed. At roughly ++ // 4us/step, this will take ~250k years to wrap. So this check could ++ // arguably be removed. ++ if self.count >= 0xffff_ffff_ffff_fff0 { ++ return None; ++ } ++ self.count += self.add_count; ++ self.current_pubkey += self.add_pubkey; ++ Some(Trial(self.count, self.current_pubkey)) ++ } ++} ++ ++pub fn make_check_predicate( ++ prefix: &str, ++ start: usize, ++ end: usize, ++) -> impl Fn(&EdwardsPoint) -> bool { ++ let prefix = String::from(prefix); ++ move |point| { ++ let public_b64 = base64::encode(point.to_montgomery().as_bytes()); ++ //println!("trial: {}", public_b64); ++ public_b64[start..end] ++ .to_ascii_lowercase() ++ .contains(&prefix) ++ } ++} ++ ++pub fn search(check: T) -> (StaticSecret, PublicKey) ++where ++ T: Fn(&EdwardsPoint) -> bool, ++{ ++ let seed = Seed::generate(); ++ let both = seed.scan().find(|(_, point)| check(&point)).unwrap(); ++ seed.convert_both(both) ++} ++ ++pub fn search_for_prefix(prefix: &str, start: usize, end: usize) -> (StaticSecret, PublicKey) { ++ let check = make_check_predicate(prefix, start, end); ++ let seed = Seed::generate(); ++ let both = seed.scan().find(|(_, point)| check(&point)).unwrap(); ++ seed.convert_both(both) ++} ++ ++/// returns checks per second ++pub fn measure_rate() -> f64 { ++ use ScanResults::*; ++ // prefix with characters that will never match ++ let check = make_check_predicate("****", 0, 10); ++ Seed::generate() ++ .scan_progress() ++ .map(|res| { ++ // timing includes the work of checking the pubkey ++ if let Trial(_count, point) = res { ++ check(&point); ++ }; ++ res ++ }) ++ .find_map(|res| res.get_rate()) ++ .unwrap() ++} ++ ++#[cfg(test)] ++mod test { ++ use super::*; ++ ++ #[test] ++ fn test_search() { ++ let check = make_check_predicate("aaa", 0, 10); ++ let (privkey, pubkey) = search(check); ++ println!( ++ "priv: {}, pub: {}", ++ base64::encode(&privkey.to_bytes()), ++ base64::encode(&pubkey.as_bytes()) ++ ); ++ } ++ ++ #[test] ++ fn test_rate() { ++ let speed = measure_rate(); ++ println!("speed: {:.3e} keys per second", speed); ++ } ++} +-- +2.36.0 + diff --git a/wireguard-vanity-address/0003-update-benchmarks-to-new-scheme.patch b/wireguard-vanity-address/0003-update-benchmarks-to-new-scheme.patch new file mode 100644 index 0000000..5b8cc98 --- /dev/null +++ b/wireguard-vanity-address/0003-update-benchmarks-to-new-scheme.patch @@ -0,0 +1,113 @@ +From d6473b2d99351fd5ec773dde7037e7fdd0cce18a Mon Sep 17 00:00:00 2001 +From: Brian Warner +Date: Tue, 3 Mar 2020 21:12:01 -0800 +Subject: [PATCH 3/5] update benchmarks to new scheme + +--- + benches/keygen.rs | 59 ++++++++++++++++++++++++++--------------------- + 1 file changed, 33 insertions(+), 26 deletions(-) + +diff --git a/benches/keygen.rs b/benches/keygen.rs +index a50062e..00dcc55 100644 +--- a/benches/keygen.rs ++++ b/benches/keygen.rs +@@ -1,63 +1,70 @@ + use criterion::{black_box, criterion_group, criterion_main, Criterion}; + +-use base64; ++use curve25519_dalek::{ ++ constants::ED25519_BASEPOINT_POINT, edwards::EdwardsPoint, montgomery::MontgomeryPoint, ++ scalar::Scalar, ++}; + use rand_core::OsRng; +-use x25519_dalek::{PublicKey, StaticSecret}; + +-use wireguard_vanity_lib::trial; ++use wireguard_vanity_lib::{make_check_predicate, Seed}; + + fn b1_point_generation(c: &mut Criterion) { +- c.bench_function("b1_point_generation", |b| { +- b.iter(|| StaticSecret::new(&mut OsRng)) +- }); ++ let seed = Seed::generate(); ++ let mut scan = seed.scan(); ++ c.bench_function("b1_point_generation", |b| b.iter(|| scan.next())); + } + + fn b2a_point_conversion(c: &mut Criterion) { +- let private = StaticSecret::new(&mut OsRng); ++ let ed_point: EdwardsPoint = Scalar::random(&mut OsRng) * ED25519_BASEPOINT_POINT; + c.bench_function("b2a_point_conversion", |b| { +- b.iter(|| PublicKey::from(&private)) ++ b.iter(|| ed_point.to_montgomery()) + }); + } + + fn b2b_point_to_bytes(c: &mut Criterion) { +- let private = StaticSecret::new(&mut OsRng); +- let public = PublicKey::from(&private); +- c.bench_function("b2b_point_to_bytes", |b| b.iter(|| public.as_bytes())); ++ let ed_point: EdwardsPoint = Scalar::random(&mut OsRng) * ED25519_BASEPOINT_POINT; ++ let mt_point: MontgomeryPoint = ed_point.to_montgomery(); ++ c.bench_function("b2b_point_to_bytes", |b| b.iter(|| mt_point.as_bytes())); + } + + fn b2c_bytes_to_base64(c: &mut Criterion) { +- let private = StaticSecret::new(&mut OsRng); +- let public = PublicKey::from(&private); +- let public_bytes = public.as_bytes(); ++ let ed_point: EdwardsPoint = Scalar::random(&mut OsRng) * ED25519_BASEPOINT_POINT; ++ let mt_point: MontgomeryPoint = ed_point.to_montgomery(); ++ let bytes = mt_point.as_bytes(); + c.bench_function("b2c_bytes_to_base64", |b| { +- b.iter(|| base64::encode(black_box(&public_bytes))) ++ b.iter(|| base64::encode(black_box(&bytes))) + }); + } + + fn b2d_base64_contains(c: &mut Criterion) { +- let private = StaticSecret::new(&mut OsRng); +- let public = PublicKey::from(&private); +- let public_b64 = base64::encode(public.as_bytes()); ++ let ed_point: EdwardsPoint = Scalar::random(&mut OsRng) * ED25519_BASEPOINT_POINT; ++ let mt_point: MontgomeryPoint = ed_point.to_montgomery(); ++ let bytes = mt_point.as_bytes(); ++ let public_b64 = base64::encode(bytes); + c.bench_function("b2d_base64_contains", |b| { + b.iter(|| public_b64[0..10].to_ascii_lowercase().contains("****")) + }); + } + + fn b2e_total_point_checking(c: &mut Criterion) { ++ let check = make_check_predicate("****", 0, 10); ++ let seed = Seed::generate(); ++ let mut scan = seed.scan(); ++ let (_count, point) = scan.next().unwrap(); + c.bench_function("b2e_total_point_checking", |b| { +- b.iter(|| { +- let private = StaticSecret::new(&mut OsRng); +- let public = PublicKey::from(&private); +- let public_b64 = base64::encode(public.as_bytes()); +- public_b64[0..10].to_ascii_lowercase().contains("****") +- }) ++ b.iter(|| check(black_box(&point))) + }); + } + + fn b3_point_generation_and_checking(c: &mut Criterion) { +- let prefix: &str = "****"; ++ let check = make_check_predicate("****", 0, 10); ++ let seed = Seed::generate(); ++ let mut scan = seed.scan(); + c.bench_function("b3_point_generation_and_checking", |b| { +- b.iter(|| trial(&prefix, 0, 10)) ++ b.iter(|| { ++ let (_count, point) = scan.next().unwrap(); ++ check(&point) ++ }) + }); + } + +-- +2.36.0 + diff --git a/wireguard-vanity-address/0004-lowercase-lol.patch b/wireguard-vanity-address/0004-lowercase-lol.patch new file mode 100644 index 0000000..56ce7fa --- /dev/null +++ b/wireguard-vanity-address/0004-lowercase-lol.patch @@ -0,0 +1,24 @@ +From c072abceaaa2250d23ed344a0b36666a831719d6 Mon Sep 17 00:00:00 2001 +From: psykose +Date: Wed, 27 Apr 2022 03:54:08 +0000 +Subject: [PATCH 4/5] lowercase lol + +--- + src/lib.rs | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/lib.rs b/src/lib.rs +index 2e6b33f..5dbe488 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -385,7 +385,6 @@ pub fn make_check_predicate( + let public_b64 = base64::encode(point.to_montgomery().as_bytes()); + //println!("trial: {}", public_b64); + public_b64[start..end] +- .to_ascii_lowercase() + .contains(&prefix) + } + } +-- +2.36.0 + diff --git a/wireguard-vanity-address/0005-sync-deps.patch b/wireguard-vanity-address/0005-sync-deps.patch new file mode 100644 index 0000000..a2d6334 --- /dev/null +++ b/wireguard-vanity-address/0005-sync-deps.patch @@ -0,0 +1,1096 @@ +From 078262c75ad91b56b986faf28d46bdf630448f34 Mon Sep 17 00:00:00 2001 +From: psykose +Date: Wed, 27 Apr 2022 03:54:19 +0000 +Subject: [PATCH 5/5] sync deps + +--- + Cargo.lock | 653 +++++++++++++++++++++++++++-------------------------- + 1 file changed, 336 insertions(+), 317 deletions(-) + +diff --git a/Cargo.lock b/Cargo.lock +index 938baf8..49293a3 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -1,743 +1,762 @@ + # This file is automatically @generated by Cargo. + # It is not intended for manual editing. ++version = 3 ++ + [[package]] + name = "ansi_term" + version = "0.11.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" + dependencies = [ +- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "winapi", + ] + + [[package]] + name = "atty" + version = "0.2.14" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" + dependencies = [ +- "hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", +- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "hermit-abi", ++ "libc", ++ "winapi", + ] + + [[package]] + name = "autocfg" +-version = "1.0.0" ++version = "1.1.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + + [[package]] + name = "base64" +-version = "0.12.0" ++version = "0.12.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + + [[package]] + name = "bitflags" +-version = "1.2.1" ++version = "1.3.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + + [[package]] + name = "bstr" +-version = "0.2.12" ++version = "0.2.17" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" + dependencies = [ +- "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "regex-automata 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ++ "lazy_static", ++ "memchr", ++ "regex-automata", ++ "serde", + ] + + [[package]] + name = "bumpalo" +-version = "3.2.1" ++version = "3.9.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" + + [[package]] + name = "byteorder" +-version = "1.3.4" ++version = "1.4.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + + [[package]] + name = "cast" +-version = "0.2.3" ++version = "0.2.7" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" + dependencies = [ +- "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ++ "rustc_version", + ] + + [[package]] + name = "cfg-if" +-version = "0.1.10" ++version = "1.0.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + + [[package]] + name = "clap" +-version = "2.33.0" ++version = "2.33.4" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "826bf7bc84f9435630275cb8e802a4a0ec792b615969934bd16d42ffed10f207" + dependencies = [ +- "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +- "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +- "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "ansi_term", ++ "atty", ++ "bitflags", ++ "strsim", ++ "textwrap", ++ "unicode-width", ++ "vec_map", + ] + + [[package]] + name = "criterion" +-version = "0.3.1" ++version = "0.3.5" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10" + dependencies = [ +- "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +- "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "criterion-plot 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +- "oorandom 11.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "plotters 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", +- "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "regex 1.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +- "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", +- "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", +- "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", +- "tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "atty", ++ "cast", ++ "clap", ++ "criterion-plot", ++ "csv", ++ "itertools", ++ "lazy_static", ++ "num-traits", ++ "oorandom", ++ "plotters", ++ "rayon", ++ "regex", ++ "serde", ++ "serde_cbor", ++ "serde_derive", ++ "serde_json", ++ "tinytemplate", ++ "walkdir", + ] + + [[package]] + name = "criterion-plot" +-version = "0.4.1" ++version = "0.4.4" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" + dependencies = [ +- "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cast", ++ "itertools", ++] ++ ++[[package]] ++name = "crossbeam-channel" ++version = "0.5.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" ++dependencies = [ ++ "cfg-if", ++ "crossbeam-utils", + ] + + [[package]] + name = "crossbeam-deque" +-version = "0.7.3" ++version = "0.8.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" + dependencies = [ +- "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if", ++ "crossbeam-epoch", ++ "crossbeam-utils", + ] + + [[package]] + name = "crossbeam-epoch" +-version = "0.8.2" ++version = "0.9.8" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" + dependencies = [ +- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +- "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", +- "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +-] +- +-[[package]] +-name = "crossbeam-queue" +-version = "0.2.1" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-dependencies = [ +- "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +- "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ++ "autocfg", ++ "cfg-if", ++ "crossbeam-utils", ++ "lazy_static", ++ "memoffset", ++ "scopeguard", + ] + + [[package]] + name = "crossbeam-utils" +-version = "0.7.2" ++version = "0.8.8" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" + dependencies = [ +- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +- "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if", ++ "lazy_static", + ] + + [[package]] + name = "csv" +-version = "1.1.3" ++version = "1.1.6" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" + dependencies = [ +- "bstr 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", +- "csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +- "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", +- "ryu 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ++ "bstr", ++ "csv-core", ++ "itoa 0.4.8", ++ "ryu", ++ "serde", + ] + + [[package]] + name = "csv-core" + version = "0.1.10" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" + dependencies = [ +- "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ++ "memchr", + ] + + [[package]] + name = "curve25519-dalek" +-version = "2.0.0" ++version = "2.1.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" + dependencies = [ +- "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +- "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "subtle 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "zeroize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "byteorder", ++ "digest", ++ "rand_core", ++ "subtle", ++ "zeroize", + ] + + [[package]] + name = "digest" + version = "0.8.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" + dependencies = [ +- "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ++ "generic-array", + ] + + [[package]] + name = "either" +-version = "1.5.3" ++version = "1.6.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + + [[package]] + name = "generic-array" +-version = "0.12.3" ++version = "0.12.4" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" + dependencies = [ +- "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", ++ "typenum", + ] + + [[package]] + name = "getrandom" +-version = "0.1.14" ++version = "0.1.16" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" + dependencies = [ +- "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", +- "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if", ++ "libc", ++ "wasi", + ] + + [[package]] +-name = "hermit-abi" +-version = "0.1.8" ++name = "half" ++version = "1.8.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" ++ ++[[package]] ++name = "hermit-abi" ++version = "0.1.19" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" + dependencies = [ +- "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc", + ] + + [[package]] + name = "itertools" +-version = "0.8.2" ++version = "0.10.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" + dependencies = [ +- "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", ++ "either", + ] + + [[package]] + name = "itoa" +-version = "0.4.5" ++version = "0.4.8" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" ++ ++[[package]] ++name = "itoa" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" + + [[package]] + name = "js-sys" +-version = "0.3.37" ++version = "0.3.57" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" + dependencies = [ +- "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ++ "wasm-bindgen", + ] + + [[package]] + name = "lazy_static" + version = "1.4.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + + [[package]] + name = "libc" +-version = "0.2.68" ++version = "0.2.124" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "21a41fed9d98f27ab1c6d161da622a4fa35e8a54a8adc24bbf3ddd0ef70b0e50" + + [[package]] + name = "log" +-version = "0.4.8" ++version = "0.4.16" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" + dependencies = [ +- "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if", + ] + +-[[package]] +-name = "maybe-uninit" +-version = "2.0.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +- + [[package]] + name = "memchr" +-version = "2.3.3" ++version = "2.4.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" + + [[package]] + name = "memoffset" +-version = "0.5.4" ++version = "0.6.5" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" + dependencies = [ +- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "autocfg", + ] + + [[package]] + name = "num-traits" +-version = "0.2.11" ++version = "0.2.14" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" + dependencies = [ +- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "autocfg", + ] + + [[package]] + name = "num_cpus" +-version = "1.12.0" ++version = "1.13.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" + dependencies = [ +- "hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", ++ "hermit-abi", ++ "libc", + ] + + [[package]] + name = "oorandom" +-version = "11.1.0" ++version = "11.1.3" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + + [[package]] + name = "plotters" +-version = "0.2.12" ++version = "0.3.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a" + dependencies = [ +- "js-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", +- "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +- "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +- "web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", ++ "num-traits", ++ "plotters-backend", ++ "plotters-svg", ++ "wasm-bindgen", ++ "web-sys", ++] ++ ++[[package]] ++name = "plotters-backend" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d88417318da0eaf0fdcdb51a0ee6c3bed624333bff8f946733049380be67ac1c" ++ ++[[package]] ++name = "plotters-svg" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "521fa9638fa597e1dc53e9412a4f9cefb01187ee1f7413076f9e6749e2885ba9" ++dependencies = [ ++ "plotters-backend", + ] + + [[package]] + name = "proc-macro2" +-version = "1.0.9" ++version = "1.0.37" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" + dependencies = [ +- "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "unicode-xid", + ] + + [[package]] + name = "quote" +-version = "1.0.3" ++version = "1.0.18" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" + dependencies = [ +- "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2", + ] + + [[package]] + name = "rand_core" + version = "0.5.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" + dependencies = [ +- "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "getrandom", + ] + + [[package]] + name = "rayon" +-version = "1.3.0" ++version = "1.5.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" + dependencies = [ +- "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "autocfg", ++ "crossbeam-deque", ++ "either", ++ "rayon-core", + ] + + [[package]] + name = "rayon-core" +-version = "1.7.0" ++version = "1.9.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" + dependencies = [ +- "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "crossbeam-channel", ++ "crossbeam-deque", ++ "crossbeam-utils", ++ "num_cpus", + ] + + [[package]] + name = "regex" +-version = "1.3.6" ++version = "1.5.5" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" + dependencies = [ +- "regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)", ++ "regex-syntax", + ] + + [[package]] + name = "regex-automata" +-version = "0.1.9" ++version = "0.1.10" + source = "registry+https://github.com/rust-lang/crates.io-index" +-dependencies = [ +- "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +-] ++checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" + + [[package]] + name = "regex-syntax" +-version = "0.6.17" ++version = "0.6.25" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + + [[package]] + name = "rustc_version" +-version = "0.2.3" ++version = "0.4.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" + dependencies = [ +- "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "semver", + ] + + [[package]] + name = "ryu" +-version = "1.0.3" ++version = "1.0.9" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" + + [[package]] + name = "same-file" + version = "1.0.6" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" + dependencies = [ +- "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ++ "winapi-util", + ] + + [[package]] + name = "scopeguard" + version = "1.1.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + + [[package]] + name = "semver" +-version = "0.9.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-dependencies = [ +- "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +-] +- +-[[package]] +-name = "semver-parser" +-version = "0.7.0" ++version = "1.0.7" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" + + [[package]] + name = "serde" +-version = "1.0.105" ++version = "1.0.136" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" ++ ++[[package]] ++name = "serde_cbor" ++version = "0.11.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" ++dependencies = [ ++ "half", ++ "serde", ++] + + [[package]] + name = "serde_derive" +-version = "1.0.105" ++version = "1.0.136" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" + dependencies = [ +- "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2", ++ "quote", ++ "syn", + ] + + [[package]] + name = "serde_json" +-version = "1.0.48" ++version = "1.0.79" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" + dependencies = [ +- "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", +- "ryu 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ++ "itoa 1.0.1", ++ "ryu", ++ "serde", + ] + + [[package]] + name = "strsim" + version = "0.8.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + + [[package]] + name = "subtle" +-version = "2.2.2" ++version = "2.4.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + + [[package]] + name = "syn" +-version = "1.0.17" ++version = "1.0.91" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" + dependencies = [ +- "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2", ++ "quote", ++ "unicode-xid", + ] + + [[package]] + name = "synstructure" +-version = "0.12.3" ++version = "0.12.6" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" + dependencies = [ +- "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +- "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2", ++ "quote", ++ "syn", ++ "unicode-xid", + ] + + [[package]] + name = "textwrap" + version = "0.11.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" + dependencies = [ +- "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ++ "unicode-width", + ] + + [[package]] + name = "tinytemplate" +-version = "1.0.3" ++version = "1.2.1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" + dependencies = [ +- "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", +- "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", ++ "serde", ++ "serde_json", + ] + + [[package]] + name = "typenum" +-version = "1.11.2" ++version = "1.15.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + + [[package]] + name = "unicode-width" +-version = "0.1.7" ++version = "0.1.9" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" + + [[package]] + name = "unicode-xid" +-version = "0.2.0" ++version = "0.2.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + + [[package]] + name = "vec_map" +-version = "0.8.1" ++version = "0.8.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + + [[package]] + name = "walkdir" +-version = "2.3.1" ++version = "2.3.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" + dependencies = [ +- "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", +- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +- "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ++ "same-file", ++ "winapi", ++ "winapi-util", + ] + + [[package]] + name = "wasi" + version = "0.9.0+wasi-snapshot-preview1" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + + [[package]] + name = "wasm-bindgen" +-version = "0.2.60" ++version = "0.2.80" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" + dependencies = [ +- "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +- "wasm-bindgen-macro 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if", ++ "wasm-bindgen-macro", + ] + + [[package]] + name = "wasm-bindgen-backend" +-version = "0.2.60" ++version = "0.2.80" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" + dependencies = [ +- "bumpalo 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +- "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +- "wasm-bindgen-shared 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ++ "bumpalo", ++ "lazy_static", ++ "log", ++ "proc-macro2", ++ "quote", ++ "syn", ++ "wasm-bindgen-shared", + ] + + [[package]] + name = "wasm-bindgen-macro" +-version = "0.2.60" ++version = "0.2.80" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" + dependencies = [ +- "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "wasm-bindgen-macro-support 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ++ "quote", ++ "wasm-bindgen-macro-support", + ] + + [[package]] + name = "wasm-bindgen-macro-support" +-version = "0.2.60" ++version = "0.2.80" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" + dependencies = [ +- "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +- "wasm-bindgen-backend 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +- "wasm-bindgen-shared 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2", ++ "quote", ++ "syn", ++ "wasm-bindgen-backend", ++ "wasm-bindgen-shared", + ] + + [[package]] + name = "wasm-bindgen-shared" +-version = "0.2.60" ++version = "0.2.80" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" + + [[package]] + name = "web-sys" +-version = "0.3.37" ++version = "0.3.57" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" + dependencies = [ +- "js-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", +- "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ++ "js-sys", ++ "wasm-bindgen", + ] + + [[package]] + name = "winapi" +-version = "0.3.8" ++version = "0.3.9" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" + dependencies = [ +- "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "winapi-i686-pc-windows-gnu", ++ "winapi-x86_64-pc-windows-gnu", + ] + + [[package]] + name = "winapi-i686-pc-windows-gnu" + version = "0.4.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + + [[package]] + name = "winapi-util" +-version = "0.1.3" ++version = "0.1.5" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" + dependencies = [ +- "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "winapi", + ] + + [[package]] + name = "winapi-x86_64-pc-windows-gnu" + version = "0.4.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + + [[package]] + name = "wireguard-vanity-address" + version = "0.4.1-alpha.0" + dependencies = [ +- "base64 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "criterion 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "curve25519-dalek 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "x25519-dalek 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "base64", ++ "clap", ++ "criterion", ++ "curve25519-dalek", ++ "num_cpus", ++ "rand_core", ++ "rayon", ++ "x25519-dalek", + ] + + [[package]] + name = "x25519-dalek" + version = "0.6.0" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "637ff90c9540fa3073bb577e65033069e4bae7c79d49d74aa3ffdf5342a53217" + dependencies = [ +- "curve25519-dalek 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "zeroize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "curve25519-dalek", ++ "rand_core", ++ "zeroize", + ] + + [[package]] + name = "zeroize" +-version = "1.1.0" ++version = "1.5.4" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7eb5728b8afd3f280a869ce1d4c554ffaed35f45c231fc41bfbd0381bef50317" + dependencies = [ +- "zeroize_derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "zeroize_derive", + ] + + [[package]] + name = "zeroize_derive" +-version = "1.0.0" ++version = "1.3.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" + dependencies = [ +- "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +- "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2", ++ "quote", ++ "syn", ++ "synstructure", + ] +- +-[metadata] +-"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +-"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +-"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +-"checksum base64 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d5ca2cd0adc3f48f9e9ea5a6bbdf9ccc0bfade884847e484d452414c7ccffb3" +-"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +-"checksum bstr 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "2889e6d50f394968c8bf4240dc3f2a7eb4680844d27308f798229ac9d4725f41" +-"checksum bumpalo 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "12ae9db68ad7fac5fe51304d20f016c911539251075a214f8e663babefa35187" +-"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +-"checksum cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +-"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +-"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +-"checksum criterion 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1fc755679c12bda8e5523a71e4d654b6bf2e14bd838dfc48cde6559a05caf7d1" +-"checksum criterion-plot 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a01e15e0ea58e8234f96146b1f91fa9d0e4dd7a38da93ff7a75d42c0b9d3a545" +-"checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +-"checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +-"checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" +-"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +-"checksum csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +-"checksum csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +-"checksum curve25519-dalek 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "26778518a7f6cffa1d25a44b602b62b979bd88adb9e99ffec546998cf3404839" +-"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +-"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +-"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +-"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +-"checksum hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" +-"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +-"checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +-"checksum js-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)" = "6a27d435371a2fa5b6d2b028a74bbdb1234f308da363226a2854ca3ff8ba7055" +-"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +-"checksum libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0" +-"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +-"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +-"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +-"checksum memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" +-"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +-"checksum num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6" +-"checksum oorandom 11.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ebcec7c9c2a95cacc7cd0ecb89d8a8454eca13906f6deb55258ffff0adeb9405" +-"checksum plotters 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "4e3bb8da247d27ae212529352020f3e5ee16e83c0c258061d27b08ab92675eeb" +-"checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" +-"checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" +-"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +-"checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +-"checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" +-"checksum regex 1.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7f6946991529684867e47d86474e3a6d0c0ab9b82d5821e314b1ede31fa3a4b3" +-"checksum regex-automata 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +-"checksum regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" +-"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +-"checksum ryu 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535622e6be132bccd223f4bb2b8ac8d53cda3c7a6394944d3b2b33fb974f9d76" +-"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +-"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +-"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +-"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +-"checksum serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)" = "e707fbbf255b8fc8c3b99abb91e7257a622caeb20a9818cbadbeeede4e0932ff" +-"checksum serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)" = "ac5d00fc561ba2724df6758a17de23df5914f20e41cb00f94d5b7ae42fffaff8" +-"checksum serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" +-"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +-"checksum subtle 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c65d530b10ccaeac294f349038a597e435b18fb456aadd0840a623f83b9e941" +-"checksum syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03" +-"checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" +-"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +-"checksum tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "57a3c6667d3e65eb1bc3aed6fd14011c6cbc3a0665218ab7f5daf040b9ec371a" +-"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" +-"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" +-"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +-"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" +-"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +-"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +-"checksum wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "2cc57ce05287f8376e998cbddfb4c8cb43b84a7ec55cf4551d7c00eef317a47f" +-"checksum wasm-bindgen-backend 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d967d37bf6c16cca2973ca3af071d0a2523392e4a594548155d89a678f4237cd" +-"checksum wasm-bindgen-macro 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "8bd151b63e1ea881bb742cd20e1d6127cef28399558f3b5d415289bc41eee3a4" +-"checksum wasm-bindgen-macro-support 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d68a5b36eef1be7868f668632863292e37739656a80fc4b9acec7b0bd35a4931" +-"checksum wasm-bindgen-shared 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "daf76fe7d25ac79748a37538b7daeed1c7a6867c92d3245c12c6222e4a20d639" +-"checksum web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)" = "2d6f51648d8c56c366144378a33290049eafdd784071077f6fe37dae64c1c4cb" +-"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +-"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +-"checksum winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" +-"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +-"checksum x25519-dalek 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "637ff90c9540fa3073bb577e65033069e4bae7c79d49d74aa3ffdf5342a53217" +-"checksum zeroize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3cbac2ed2ba24cc90f5e06485ac8c7c1e5449fe8911aef4d8877218af021a5b8" +-"checksum zeroize_derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de251eec69fc7c1bc3923403d18ececb929380e016afe103da75f396704f8ca2" +-- +2.36.0 + diff --git a/wireguard-vanity-address/APKBUILD b/wireguard-vanity-address/APKBUILD index 9d41589..567028c 100644 --- a/wireguard-vanity-address/APKBUILD +++ b/wireguard-vanity-address/APKBUILD @@ -1,16 +1,22 @@ # Contributor: psykose # Maintainer: psykose pkgname=wireguard-vanity-address -pkgver=0.4.0 -pkgrel=1 +pkgver=0.4.0_git20200327 +_gitrev=d36eeac325ba3f27111ef4b17d171e695ff75552 +pkgrel=2 pkgdesc="generate Wireguard keypairs with a given prefix string" url="https://github.com/warner/wireguard-vanity-address" arch="all" license="MIT" makedepends="cargo" -source="https://github.com/warner/wireguard-vanity-address/archive/refs/tags/v$pkgver/wireguard-vanity-address-v$pkgver.tar.gz - more-features.patch +source="https://github.com/warner/wireguard-vanity-address/archive/$_gitrev/wireguard-vanity-address-$_gitrev.tar.gz + 0001-add-curve25519-dalek-dependency.patch + 0002-new-search-algorithm-point-addition-not-scalarmult.patch + 0003-update-benchmarks-to-new-scheme.patch + 0004-lowercase-lol.patch + 0005-sync-deps.patch " +builddir="$srcdir/$pkgname-$_gitrev" options="!check" # no tests export CARGO_HOME="$srcdir" @@ -34,6 +40,10 @@ package() { } sha512sums=" -7be6823b01dc7741018f6e98a3a91ad84f290d586d4418c9f65f5966141c89bd5e5bd80e856286d6c7ff2f756ca20342169d4b57016ac90882a5c9f74643a11e wireguard-vanity-address-v0.4.0.tar.gz -e5801d0d6ad448fec2a5db7152d9f3fe17324cb79f7d09941106b7a0c9126e1d0ebce5a3157d07f69d3a8879dde6c95232d901ccbdbc054fac1aa3ae70d6f6e8 more-features.patch +60b9e79517ab221fe597b3bf2cb8a01498758768aa9bd0855c7e1b31dde7399bc004c71f4cfd0a2cd87a0542e4012aa16e5539561b1d46534b806d6940cdedb0 wireguard-vanity-address-d36eeac325ba3f27111ef4b17d171e695ff75552.tar.gz +79397a36ecd446fbbe1be4138f841289057be257cafca41f453223fa01991cc23fcc0c835a870da6f0a72ffb3e0e00901a9d941b85133f7ba3bc1a071d78ce7d 0001-add-curve25519-dalek-dependency.patch +a00d7241819bda4adb0c2233f26908798a7087171a975dcc442e7b090a3d038564bf3ec9629312f5e9d1cf5285e0a43a10076d480cb8975232ded9d619b5dbce 0002-new-search-algorithm-point-addition-not-scalarmult.patch +d81318fa5810223601d72923bc251bea08c13b850add03483cd09910eadbd2a89c0cdf48eef6e4c68c41d8ab2e3d8ad22ca6e695ed54f08cf63eccc2d5ee64d4 0003-update-benchmarks-to-new-scheme.patch +359f7ff6a90882aea8f4fc08f9e4d13c73b1e1ee927dfa5d0ffd4189c9b365887ca4582082b94036582a04037ea92dd36d12886001f224428b262d462427af75 0004-lowercase-lol.patch +de0629aa7fb5bee82ef1da4fe0e7e6f2eaa8bb932f793cb72199531c09fdc5536d7bc5a16fe1210b7e1e03206dd51176621cdb1e27866c7afe59b8b05eb68651 0005-sync-deps.patch " diff --git a/wireguard-vanity-address/more-features.patch b/wireguard-vanity-address/more-features.patch deleted file mode 100644 index d8338ae..0000000 --- a/wireguard-vanity-address/more-features.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 89b5d55f62bcfdc7c13b43981e0725b6860ebad2 Mon Sep 17 00:00:00 2001 -From: ThinkChaos -Date: Fri, 24 Apr 2020 22:21:55 +0200 -Subject: [PATCH] Add `--case-sensitive` and allow `--in 0` meaning actual - prefix - ---- - src/bin.rs | 20 +++++++++++++------- - src/lib.rs | 15 +++++++++++---- - 2 files changed, 24 insertions(+), 11 deletions(-) - -diff --git a/src/bin.rs b/src/bin.rs -index a5a6f35..c18d430 100644 ---- a/src/bin.rs -+++ b/src/bin.rs -@@ -8,12 +8,11 @@ use num_cpus; - use rayon::prelude::*; - use wireguard_vanity_lib::trial; - --fn estimate_one_trial() -> Duration { -- let prefix = "prefix"; -+fn estimate_one_trial(prefix: &str, end: usize, case_sensitive: bool) -> Duration { - let start = SystemTime::now(); - const COUNT: u32 = 100; - (0..COUNT).for_each(|_| { -- trial(&prefix, 0, 10); -+ trial(&prefix, end, case_sensitive); - }); - let elapsed = start.elapsed().unwrap(); - elapsed.checked_div(COUNT).unwrap() -@@ -86,11 +85,16 @@ fn main() -> Result<(), Box> { - .version("0.3.1") - .author("Brian Warner ") - .about("finds Wireguard keypairs with a given string prefix") -+ .arg( -+ Arg::with_name("CASE") -+ .long("case-sensitive") -+ .help("Use case-sensitive matching"), -+ ) - .arg( - Arg::with_name("RANGE") - .long("in") - .takes_value(true) -- .help("NAME must be found within first RANGE chars of pubkey (default: 10)"), -+ .help("NAME must be found within first RANGE chars of pubkey (default: 10, 0 means actual prefix)"), - ) - .arg( - Arg::with_name("NAME") -@@ -98,6 +102,7 @@ fn main() -> Result<(), Box> { - .help("string to find near the start of the pubkey"), - ) - .get_matches(); -+ let case_sensitive = matches.is_present("CASE"); - let prefix = matches.value_of("NAME").unwrap().to_ascii_lowercase(); - let len = prefix.len(); - let end: usize = 44.min(match matches.value_of("RANGE") { -@@ -110,6 +115,7 @@ fn main() -> Result<(), Box> { - } - } - }); -+ let end = if end == 0 { len } else { end }; - if end < len { - return Err(ParseError(format!("range {} is too short for len={}", end, len)).into()); - } -@@ -119,7 +125,7 @@ fn main() -> Result<(), Box> { - let mut num = offsets; - let mut denom = 1u64; - prefix.chars().for_each(|c| { -- if c.is_ascii_alphabetic() { -+ if !case_sensitive && c.is_ascii_alphabetic() { - num *= 2; // letters can match both uppercase and lowercase - } - denom *= 64; // base64 -@@ -136,7 +142,7 @@ fn main() -> Result<(), Box> { - // run at half the speed that this predicts. - - if trials_per_key < 2u64.pow(32) { -- let est = estimate_one_trial(); -+ let est = estimate_one_trial(&prefix, end, case_sensitive); - println!( - "one trial takes {}, CPU cores available: {}", - format_time(duration_to_f64(est)), -@@ -162,7 +168,7 @@ fn main() -> Result<(), Box> { - // 1M trials takes about 10s on my laptop, so let it run for 1000s - (0..100_000_000) - .into_par_iter() -- .map(|_| trial(&prefix, 0, end)) -+ .map(|_| trial(&prefix, end, case_sensitive)) - .filter_map(|r| r) - .try_for_each(print)?; - Ok(()) -diff --git a/src/lib.rs b/src/lib.rs -index 31138c5..fb95581 100644 ---- a/src/lib.rs -+++ b/src/lib.rs -@@ -1,15 +1,22 @@ - use base64; - use rand::thread_rng; -+use std::borrow::Cow; - use x25519_dalek::{PublicKey, StaticSecret}; - --pub fn trial(prefix: &str, start: usize, end: usize) -> Option<(String, String)> { -+pub fn trial(prefix: &str, end: usize, case_sensitive: bool) -> Option<(String, String)> { - let mut rng = thread_rng(); - let private = StaticSecret::new(&mut rng); - let public = PublicKey::from(&private); -+ - let public_b64 = base64::encode(public.as_bytes()); -- if public_b64[start..end] -- .to_ascii_lowercase() -- .contains(&prefix) -+ -+ let b64_prefix = if case_sensitive { -+ Cow::Borrowed(&public_b64[..end]) -+ } else { -+ Cow::Owned(public_b64[..end].to_ascii_lowercase()) -+ }; -+ -+ if b64_prefix.contains(prefix) - { - let private_b64 = base64::encode(&private.to_bytes()); - Some((private_b64, public_b64))