Reorganize repo to Rust format
This commit is contained in:
parent
aa7fae385c
commit
b945051c47
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "bridge_auth"
|
name = "lox_test"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "bridgedb"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2021"
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
lox = { git = "https://git-crysp.uwaterloo.ca/iang/lox.git" }
|
|
|
@ -8,7 +8,7 @@ use std::io::Write;
|
||||||
fn main() {
|
fn main() {
|
||||||
// import bridgedb pubkey
|
// import bridgedb pubkey
|
||||||
// note: currently no checks for valid data
|
// note: currently no checks for valid data
|
||||||
let infile = std::fs::File::open("../pubkeys/bridgedb_pubkey").unwrap();
|
let infile = std::fs::File::open("bridgedb_pubkey").unwrap();
|
||||||
let mut reader = BufReader::new(infile);
|
let mut reader = BufReader::new(infile);
|
||||||
let mut buffer = Vec::new();
|
let mut buffer = Vec::new();
|
||||||
reader
|
reader
|
||||||
|
@ -28,7 +28,7 @@ fn main() {
|
||||||
count += 1;
|
count += 1;
|
||||||
let pubkey_bytes = pubkey.compress().to_bytes();
|
let pubkey_bytes = pubkey.compress().to_bytes();
|
||||||
// Is this the proper way to concatenate an integer and a string?
|
// Is this the proper way to concatenate an integer and a string?
|
||||||
let mut outfile = File::create(format!("{}{}", "../pubkeys/bridge_auth_pubkey_", count))
|
let mut outfile = File::create(format!("bridge_auth_pubkey_{}", count))
|
||||||
.expect("Failed to create pubkey file");
|
.expect("Failed to create pubkey file");
|
||||||
outfile
|
outfile
|
||||||
.write_all(&pubkey_bytes)
|
.write_all(&pubkey_bytes)
|
|
@ -9,7 +9,7 @@ fn main() {
|
||||||
// output public key to new file
|
// output public key to new file
|
||||||
let pubkey_bytes = bridgedb.pubkey.to_bytes();
|
let pubkey_bytes = bridgedb.pubkey.to_bytes();
|
||||||
let mut outfile =
|
let mut outfile =
|
||||||
File::create("../pubkeys/bridgedb_pubkey").expect("Failed to create pubkey file");
|
File::create("bridgedb_pubkey").expect("Failed to create pubkey file");
|
||||||
outfile.write_all(&pubkey_bytes)
|
outfile.write_all(&pubkey_bytes)
|
||||||
.expect("Failed to write pubkey");
|
.expect("Failed to write pubkey");
|
||||||
}
|
}
|
Loading…
Reference in New Issue