List products for given BINK ID

This commit is contained in:
Alex Page 2023-06-24 18:07:48 -04:00
parent d59d78664a
commit b2609ecda4

View file

@ -48,6 +48,13 @@ fn generate(args: &GenerateArgs) -> Result<()> {
let bink_id = args.bink_id.to_ascii_uppercase();
let bink = &keys.bink[&bink_id];
println!("Using BINK ID {bink_id}, which applies to these products:");
for (key, value) in keys.products.iter() {
if value.bink.contains(&bink_id) {
println!(" {}", key);
}
}
// gen_order is the order of the generator G, a value we have to reverse -> Schoof's Algorithm.
let gen_order = &bink.n;
@ -72,6 +79,14 @@ fn validate(args: &ValidateArgs) -> Result<()> {
// No private key or gen_order is required.
let keys = load_keys(args.keys_path.as_ref())?;
let bink_id = args.bink_id.to_ascii_uppercase();
println!("Using BINK ID {bink_id}, which applies to these products:");
for (key, value) in keys.products.iter() {
if value.bink.contains(&bink_id) {
println!(" {}", key);
}
}
let bink = &keys.bink[&bink_id];
let curve = initialize_curve(bink, &bink_id)?;