From a56ac8786882c9625bff2efbf05051429ff58844 Mon Sep 17 00:00:00 2001 From: Ian Goldberg Date: Sat, 5 Jun 2021 13:36:09 -0400 Subject: [PATCH] Change IssuerPubKey constructor to be more functional --- crates/lox-library/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/lox-library/src/lib.rs b/crates/lox-library/src/lib.rs index 253313a..c74686c 100644 --- a/crates/lox-library/src/lib.rs +++ b/crates/lox-library/src/lib.rs @@ -95,9 +95,8 @@ impl IssuerPubKey { X.push(&privkey.x0tilde * Atable + &privkey.x[0] * Btable); // The other elements (1 through n) are X[i] = x[i]*A - for i in 1..n_plus_one { - X.push(&privkey.x[i] * Atable); - } + X.extend(privkey.x.iter().skip(1).map(|xi| xi * Atable)); + IssuerPubKey { X } } }