Skip to content

Ruby protocol: milestone 1#266

Merged
semuelle merged 8 commits intow3f:masterfrom
Ruby-Protocol:master
Oct 22, 2021
Merged

Ruby protocol: milestone 1#266
semuelle merged 8 commits intow3f:masterfrom
Ruby-Protocol:master

Conversation

@rubyprotocol
Copy link
Copy Markdown
Contributor

@rubyprotocol rubyprotocol commented Sep 2, 2021

Milestone Delivery Checklist

Link to the application pull request: w3f/Grants-Program#311.

@mmagician
Copy link
Copy Markdown
Contributor

Thanks for the delivery. We'll review it as soon as we can!

@musicarroll
Copy link
Copy Markdown
Contributor

@rubyprotocol @mmagician Hi, I'm Mike Carroll, the new kid on the block, helping Marcin and Robert review the ruby protocol milestone deliverables. Hope you don't mind a few newbie questions / comments. I've reviewed most of the high level artifacts and am now jumping into the code a little bit. BTW, I really like your architecture and your concept. FE and SMCP seem to be key technology enablers for data privacy and monetization.
Regarding the code base for Functional_encryption_rust, I downloaded and ran the example.rs and example2.rs in src/bin and was wondering about how to determine the correctness of the outputs and wondering if you plan to put in some typical Rust assertions via [#test] functions.

@musicarroll
Copy link
Copy Markdown
Contributor

musicarroll commented Sep 14, 2021

@rubyprotocol @mmagician Also, I ran the cargo test test_sip as per the unit test guide and got 0 passed 0 failed 0 ignored.
[2021-09-15] I think I found the problem. It seems that if I run the same tests from the private_ml project, I do get some results:
---- test_sip stdout ----
Groud truth: 3408
[SIP Encrypt]: 251.11ms
[SIP Derive FE Key]: 4.44ms
[SIP Decrypt]: 545.64ms

successes:
test_sip

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.96s

 Running tests/test_utils.rs (target/debug/deps/test_utils-d140a01d630f1aa6)

running 0 tests

successes:

successes:

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.00s

 Running tests/test_zk.rs (target/debug/deps/test_zk-ba7a4801f0c9ccfb)

running 0 tests

successes:

successes:

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.00s

Still, it seems to be very light testing. Perhaps you could document your plan for more robust testing in the user test guide. Thoughts?

@musicarroll
Copy link
Copy Markdown
Contributor

@rubyprotocol @mmagician Likewise I got 0 results for all the other three tests
cargo test test_sgp -- --show-output
cargo test test_disease_prediction -- --show-output
cargo test test_neural_network -- --show-output

@musicarroll
Copy link
Copy Markdown
Contributor

musicarroll commented Sep 14, 2021

@rubyprotocol @mmagician Since the FE components are basically a rewrite in Rust of the previous C implementation, wouldn't it make sense to re-use some of the same validation tests that were used on the C implementation to ensure that the same results are obtained?

@musicarroll
Copy link
Copy Markdown
Contributor

@rubyprotocol @mmagician @Lederstrumpf @lornacrevelingwgo23

The Build and Run instructions in the user guide begin with these lines:

Install Rust

curl --tlsv1.2 https://sh.rustup.rs -sSf | sh

Build the project

cargo build

However, since some of the same code and directory structure is duplicated in the Functional_encryption project, perhaps it would be helpful if you included here the specific github clone instructions before the build command. E.g., the above snippet could read:

Install Rust

curl --tlsv1.2 https://sh.rustup.rs -sSf | sh

Clone the project:

git clone https://github.com/Ruby-Protocol/private_ml.git
cd private_ml

Build the project

cargo build

My mistake above was to download the Functional_encryption project and run the cargo test commands on that, only to get 0 results. The results now being obtained are looking better (see previous posts of mine).

@musicarroll
Copy link
Copy Markdown
Contributor

musicarroll commented Sep 16, 2021

@rubyprotocol @mmagician @Lederstrumpf
The benchmarks report lists three Schemes but does not indicate which tests these schemes correlate too. I've guessing the first two are inner product and quadratic, but the third scheme may be disease prediction or neural network. Please document which schemes are meant by each of the three benchmark runs.
Also, it would be useful to know how these benchmark results compare with previously run benchmarks for the C implementations. The computation times seem to scale almost linearly with the vector size, but I would expect this to ultimately have an asymptote.
Finally, what size vectors do you anticipate for various Ruby data monetization use cases?

@lornacrevelingwgo23
Copy link
Copy Markdown

@rubyprotocol @mmagician Hi, I'm Mike Carroll, the new kid on the block, helping Marcin and Robert review the ruby protocol milestone deliverables. Hope you don't mind a few newbie questions / comments. I've reviewed most of the high level artifacts and am now jumping into the code a little bit. BTW, I really like your architecture and your concept. FE and SMCP seem to be key technology enablers for data privacy and monetization.
Regarding the code base for Functional_encryption_rust, I downloaded and ran the example.rs and example2.rs in src/bin and was wondering about how to determine the correctness of the outputs and wondering if you plan to put in some typical Rust assertions via [#test] functions.

Hey @musicarroll , thanks for your comments and sorry for the late response. I haven't checked this pr for a while and only see your comments today. Will get back to you soon regarding your comments.

@mmagician
Copy link
Copy Markdown
Contributor

@lornacrevelingwgo23 @rubyprotocol I've merged @musicarroll 's evaluation as "In progress" for now, and submitted my own first round of evaluation here. Please address the issues raised in both evaluations in order to proceed further.

@mmagician
Copy link
Copy Markdown
Contributor

@lornacrevelingwgo23 Any updates regarding the feedback you received on your milestone?

@lornacrevelingwgo23
Copy link
Copy Markdown

@lornacrevelingwgo23 Any updates regarding the feedback you received on your milestone?

@mmagician Sorry for the late response. Several members of our team were out of the office the last few weeks, which caused the delay. We have updated the private ml repo and modified the code and relevant documents. I have also provided a reponse to your evaluation, in which we have addressed your raised issues one by one. Please let me know if there is any question. Thanks.

@mmagician
Copy link
Copy Markdown
Contributor

Thanks for the updates. There are still a few things:

  • lack of a common interface between various encryption schemes. I am aware that each scheme is ultimately different in what is encrypted / decrypted and how the FE decryption key is derived, but currently it looks a little bit as if different people wrote different schemes without consultation with one another. For example, the order of (shared) parameters across decrypt in dmcfe and sip is different, as well as the parameter naming. It would be great if you could develop a common interface for the shared types and functions. As a first step, I've created a PR to demonstrate what I mean. My contribution will work for only Inner Product at the moment, but if it is adapted well, it could serve as a shared trait for all of your schemes - you get the idea. I'm not an expert on FE schemes and I imagine that this expert knowledge would come in handy when optimising the trait for implementation across all of your current (and potentially future) schemes. This will come especially useful once you start integrating this into substrate, which heavily relies on generic types.
  • Running cargo test doesn't work anymore from the root of private_ml repo. I believe this is due to failing doctests - you wrote nice examples inside the documentation, but these are currently failing to compile and run. It takes a while to get used to writing good doctests, as the environment they are run in is not obvious: it's as if they're integration tests and so need to import all the crates again (the current crate is implicitly imported, but no more than that).
failures:
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::decrypt (line 275)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::derive_fe_key (line 215)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::derive_fe_key_share (line 173)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::encrypt (line 136)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::key_comb (line 252)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::set_share (line 89)
    src/ml/disease_prediction.rs - ml::disease_prediction::DiseasePrediction::compute (line 63)
    src/ml/disease_prediction.rs - ml::disease_prediction::DiseasePrediction::encrypt (line 48)
    src/ml/disease_prediction.rs - ml::disease_prediction::DiseasePrediction::new (line 24)
    src/ml/neural_network.rs - ml::neural_network::NeuralNetwork::compute (line 69)
    src/ml/neural_network.rs - ml::neural_network::NeuralNetwork::encrypt (line 54)
    src/ml/neural_network.rs - ml::neural_network::NeuralNetwork::new (line 24)
    src/quadratic_sgp.rs - quadratic_sgp::Sgp::decrypt (line 262)
    src/quadratic_sgp.rs - quadratic_sgp::Sgp::derive_fe_key (line 215)
    src/quadratic_sgp.rs - quadratic_sgp::Sgp::encrypt (line 109)
    src/simple_ip.rs - simple_ip::Sip (line 27)
    src/simple_ip.rs - simple_ip::Sip<L>::decrypt (line 156)
    src/simple_ip.rs - simple_ip::Sip<L>::derive_fe_key (line 134)
    src/simple_ip.rs - simple_ip::Sip<L>::encrypt (line 102)
    src/simple_ip.rs - simple_ip::Sip<L>::new (line 71)
    src/zk/dlog.rs - zk::dlog::ZkDlog::generate (line 46)
    src/zk/qp.rs - zk::qp::ZkQp<L>::generate (line 103)
    src/zk/sip.rs - zk::sip::ZkSip<L>::generate (line 96)

test result: FAILED. 4 passed; 23 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.41s
  • I still see clippy errors: warning: ruby (lib) generated 71 warnings

@lornacrevelingwgo23
Copy link
Copy Markdown

Thanks for the updates. There are still a few things:

  • lack of a common interface between various encryption schemes. I am aware that each scheme is ultimately different in what is encrypted / decrypted and how the FE decryption key is derived, but currently it looks a little bit as if different people wrote different schemes without consultation with one another. For example, the order of (shared) parameters across decrypt in dmcfe and sip is different, as well as the parameter naming. It would be great if you could develop a common interface for the shared types and functions. As a first step, I've created a PR to demonstrate what I mean. My contribution will work for only Inner Product at the moment, but if it is adapted well, it could serve as a shared trait for all of your schemes - you get the idea. I'm not an expert on FE schemes and I imagine that this expert knowledge would come in handy when optimising the trait for implementation across all of your current (and potentially future) schemes. This will come especially useful once you start integrating this into substrate, which heavily relies on generic types.
  • Running cargo test doesn't work anymore from the root of private_ml repo. I believe this is due to failing doctests - you wrote nice examples inside the documentation, but these are currently failing to compile and run. It takes a while to get used to writing good doctests, as the environment they are run in is not obvious: it's as if they're integration tests and so need to import all the crates again (the current crate is implicitly imported, but no more than that).
failures:
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::decrypt (line 275)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::derive_fe_key (line 215)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::derive_fe_key_share (line 173)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::encrypt (line 136)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::key_comb (line 252)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::set_share (line 89)
    src/ml/disease_prediction.rs - ml::disease_prediction::DiseasePrediction::compute (line 63)
    src/ml/disease_prediction.rs - ml::disease_prediction::DiseasePrediction::encrypt (line 48)
    src/ml/disease_prediction.rs - ml::disease_prediction::DiseasePrediction::new (line 24)
    src/ml/neural_network.rs - ml::neural_network::NeuralNetwork::compute (line 69)
    src/ml/neural_network.rs - ml::neural_network::NeuralNetwork::encrypt (line 54)
    src/ml/neural_network.rs - ml::neural_network::NeuralNetwork::new (line 24)
    src/quadratic_sgp.rs - quadratic_sgp::Sgp::decrypt (line 262)
    src/quadratic_sgp.rs - quadratic_sgp::Sgp::derive_fe_key (line 215)
    src/quadratic_sgp.rs - quadratic_sgp::Sgp::encrypt (line 109)
    src/simple_ip.rs - simple_ip::Sip (line 27)
    src/simple_ip.rs - simple_ip::Sip<L>::decrypt (line 156)
    src/simple_ip.rs - simple_ip::Sip<L>::derive_fe_key (line 134)
    src/simple_ip.rs - simple_ip::Sip<L>::encrypt (line 102)
    src/simple_ip.rs - simple_ip::Sip<L>::new (line 71)
    src/zk/dlog.rs - zk::dlog::ZkDlog::generate (line 46)
    src/zk/qp.rs - zk::qp::ZkQp<L>::generate (line 103)
    src/zk/sip.rs - zk::sip::ZkSip<L>::generate (line 96)

test result: FAILED. 4 passed; 23 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.41s
  • I still see clippy errors: warning: ruby (lib) generated 71 warnings

Thanks for the prompt response. Will get back to you on this ASAP.

@mmagician mmagician self-assigned this Oct 12, 2021
@lornacrevelingwgo23
Copy link
Copy Markdown

Thanks for the updates. There are still a few things:

  • lack of a common interface between various encryption schemes. I am aware that each scheme is ultimately different in what is encrypted / decrypted and how the FE decryption key is derived, but currently it looks a little bit as if different people wrote different schemes without consultation with one another. For example, the order of (shared) parameters across decrypt in dmcfe and sip is different, as well as the parameter naming. It would be great if you could develop a common interface for the shared types and functions. As a first step, I've created a PR to demonstrate what I mean. My contribution will work for only Inner Product at the moment, but if it is adapted well, it could serve as a shared trait for all of your schemes - you get the idea. I'm not an expert on FE schemes and I imagine that this expert knowledge would come in handy when optimising the trait for implementation across all of your current (and potentially future) schemes. This will come especially useful once you start integrating this into substrate, which heavily relies on generic types.
  • Running cargo test doesn't work anymore from the root of private_ml repo. I believe this is due to failing doctests - you wrote nice examples inside the documentation, but these are currently failing to compile and run. It takes a while to get used to writing good doctests, as the environment they are run in is not obvious: it's as if they're integration tests and so need to import all the crates again (the current crate is implicitly imported, but no more than that).
failures:
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::decrypt (line 275)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::derive_fe_key (line 215)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::derive_fe_key_share (line 173)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::encrypt (line 136)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::key_comb (line 252)
    src/dmcfe_ip.rs - dmcfe_ip::Dmcfe::set_share (line 89)
    src/ml/disease_prediction.rs - ml::disease_prediction::DiseasePrediction::compute (line 63)
    src/ml/disease_prediction.rs - ml::disease_prediction::DiseasePrediction::encrypt (line 48)
    src/ml/disease_prediction.rs - ml::disease_prediction::DiseasePrediction::new (line 24)
    src/ml/neural_network.rs - ml::neural_network::NeuralNetwork::compute (line 69)
    src/ml/neural_network.rs - ml::neural_network::NeuralNetwork::encrypt (line 54)
    src/ml/neural_network.rs - ml::neural_network::NeuralNetwork::new (line 24)
    src/quadratic_sgp.rs - quadratic_sgp::Sgp::decrypt (line 262)
    src/quadratic_sgp.rs - quadratic_sgp::Sgp::derive_fe_key (line 215)
    src/quadratic_sgp.rs - quadratic_sgp::Sgp::encrypt (line 109)
    src/simple_ip.rs - simple_ip::Sip (line 27)
    src/simple_ip.rs - simple_ip::Sip<L>::decrypt (line 156)
    src/simple_ip.rs - simple_ip::Sip<L>::derive_fe_key (line 134)
    src/simple_ip.rs - simple_ip::Sip<L>::encrypt (line 102)
    src/simple_ip.rs - simple_ip::Sip<L>::new (line 71)
    src/zk/dlog.rs - zk::dlog::ZkDlog::generate (line 46)
    src/zk/qp.rs - zk::qp::ZkQp<L>::generate (line 103)
    src/zk/sip.rs - zk::sip::ZkSip<L>::generate (line 96)

test result: FAILED. 4 passed; 23 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.41s
  • I still see clippy errors: warning: ruby (lib) generated 71 warnings

Thanks for your comments. We have updated the code (https://github.com/Ruby-Protocol/private_ml) according to your advice. Please let me know if there are any other problems.

@semuelle semuelle self-assigned this Oct 18, 2021
@semuelle
Copy link
Copy Markdown
Contributor

Hi @lornacrevelingwgo23, I'm checking your updates as Marcin is out of office. I see that you have addressed all evaluation notes either in your response document or here. I just noticed two things:

  • I still get 55 warnings from clippy,
  • if all the code and work has been moved from Functional_encryption_rust, could you update the link in the delivery document to a matching one in the private_ml repo? Especially because the old repo still contains unattributed code.

@rubyprotocol
Copy link
Copy Markdown
Contributor Author

Hi @lornacrevelingwgo23, I'm checking your updates as Marcin is out of office. I see that you have addressed all evaluation notes either in your response document or here. I just noticed two things:

  • I still get 55 warnings from clippy,

Hey, thanks for your comments. Will check with my team and see if we can further reduce the warnings.

  • if all the code and work has been moved from Functional_encryption_rust, could you update the link in the delivery document to a matching one in the private_ml repo? Especially because the old repo still contains unattributed code.

Already update the delivery document, and here is the link to the updated document: https://github.com/Ruby-Protocol/Grant-Milestone-Delivery/blob/master/deliveries/ruby_milestone_1.md. Please let me know if there are any other problems.

@lornacrevelingwgo23
Copy link
Copy Markdown

lornacrevelingwgo23 commented Oct 20, 2021

Hi @lornacrevelingwgo23, I'm checking your updates as Marcin is out of office. I see that you have addressed all evaluation notes either in your response document or here. I just noticed two things:

  • I still get 55 warnings from clippy,

@semuelle Would you mind telling me exactly what type of operating system and rust version you are currently running? We test our code on MacOS Big Sur version 11.6 and our Rust cargo version is 1.51.0. We haven't received any warning when we run our code in this setting. Is it possible the warnings are caused by older-version Rust?

@semuelle
Copy link
Copy Markdown
Contributor

Would you mind telling me exactly what type of operating system and rust version you are currently running?

Ubuntu 20.04
cargo 1.51.0 (43b129a20 2021-03-16)

Here's the output for completeness:

❯ cargo clippy
warning: name `GT` contains a capitalized acronym
  --> src/define.rs:16:10
   |
16 | pub type GT = FP12;
   |          ^^ help: consider making the acronym lowercase, except the initial letter: `Gt`
   |
   = note: `#[warn(clippy::upper_case_acronyms)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `RandUtilsRAND` contains a capitalized acronym
  --> src/utils/rand_utils.rs:26:12
   |
26 | pub struct RandUtilsRAND {
   |            ^^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `RandUtilsRand`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: 7 bindings with single-character names in scope
  --> src/utils/mod.rs:61:29
   |
61 | pub fn baby_step_giant_step(h: &GT, g: &GT, bound: &BigNum) -> Option<BigInt> {
   |                             ^       ^
...
69 |     let b = BigInt::from_str_radix(&bound.tostring(), 16).unwrap();
   |         ^
...
72 |     let m = BigNum::fromstring(temp.to_str_radix(16));
   |         ^
...
75 |     let (mut x, mut z) = (GT::new(), GT::new_copy(&g));
   |              ^      ^
76 |     let mut i = BigNum::new_int(0);
   |             ^
   |
   = note: `#[warn(clippy::many_single_char_names)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names

warning: 7 bindings with single-character names in scope
  --> src/utils/mod.rs:61:29
   |
61 | pub fn baby_step_giant_step(h: &GT, g: &GT, bound: &BigNum) -> Option<BigInt> {
   |                             ^       ^
...
69 |     let b = BigInt::from_str_radix(&bound.tostring(), 16).unwrap();
   |         ^
...
72 |     let m = BigNum::fromstring(temp.to_str_radix(16));
   |         ^
...
75 |     let (mut x, mut z) = (GT::new(), GT::new_copy(&g));
   |              ^      ^
76 |     let mut i = BigNum::new_int(0);
   |             ^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names

warning: 7 bindings with single-character names in scope
   --> src/utils/mod.rs:127:32
    |
127 | pub fn baby_step_giant_step_g1(h: &G1, g: &G1, bound: &BigNum) -> Option<BigInt> {
    |                                ^       ^
...
134 |     let b = BigInt::from_str_radix(&bound.tostring(), 16).unwrap();
    |         ^
...
137 |     let m = BigNum::fromstring(temp.to_str_radix(16));
    |         ^
...
140 |     let (mut x, mut z) = (G1::new(), g.clone());
    |              ^      ^
141 |     let mut i = BigNum::new_int(0);
    |             ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names

warning: 5 bindings with single-character names in scope
   --> src/quadratic_sgp.rs:103:14
    |
103 |         let (x, y) = (&plain.x, &plain.y);
    |              ^  ^
...
110 |         let w = BigNumMatrix2x2::new_random(&(CURVE_ORDER));
    |             ^
...
118 |         let mut a: G1Vector = vec![G1::generator(); L * 2];
    |                 ^
119 |         let mut b: G2Vector = vec![G2::generator(); L * 2];
    |                 ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names

warning: name `JJParams` contains a capitalized acronym
  --> src/zk/dlog.rs:21:6
   |
21 | type JJParams = JubJubBN256;
   |      ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `JjParams`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: redundant field names in struct initialization
  --> src/zk/dlog.rs:59:13
   |
59 |             inputs: inputs,
   |             ^^^^^^^^^^^^^^ help: replace it with: `inputs`
   |
   = note: `#[warn(clippy::redundant_field_names)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: name `JJParams` contains a capitalized acronym
  --> src/zk/qp.rs:29:6
   |
29 | type JJParams = JubJubBN256;
   |      ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `JjParams`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `QPProofPublic` contains a capitalized acronym
  --> src/zk/qp.rs:33:12
   |
33 | pub struct QPProofPublic<Fr: PrimeField, const L: usize> {
   |            ^^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `QpProofPublic`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `CQPProofPublic` contains a capitalized acronym
  --> src/zk/qp.rs:44:12
   |
44 | pub struct CQPProofPublic<C: CS, const L: usize> {
   |            ^^^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `CqpProofPublic`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `QPProofSecret` contains a capitalized acronym
  --> src/zk/qp.rs:54:12
   |
54 | pub struct QPProofSecret<Fr: PrimeField, const L: usize> {
   |            ^^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `QpProofSecret`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `CQPProofSecret` contains a capitalized acronym
  --> src/zk/qp.rs:63:12
   |
63 | pub struct CQPProofSecret<C: CS, const L: usize> {
   |            ^^^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `CqpProofSecret`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: redundant field names in struct initialization
   --> src/zk/qp.rs:160:13
    |
160 |             inputs: inputs,
    |             ^^^^^^^^^^^^^^ help: replace it with: `inputs`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: name `JJParams` contains a capitalized acronym
  --> src/zk/sip.rs:24:6
   |
24 | type JJParams = JubJubBN256;
   |      ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `JjParams`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: 5 bindings with single-character names in scope
   --> src/zk/sip.rs:107:21
    |
107 |     pub fn generate(g: &EdwardsPoint<Fr>, h: &EdwardsPoint<Fr>, s: &SizedVec<Num<Fr>, L>, y: &SizedVec<Num<Fr>, L>) -> SnarkInfo<E> {
    |                     ^                     ^                     ^                         ^
...
111 |         let r: Num<Fr> = rng.gen();
    |             ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names

warning: 6 bindings with single-character names in scope
   --> src/zk/sip.rs:107:21
    |
107 |     pub fn generate(g: &EdwardsPoint<Fr>, h: &EdwardsPoint<Fr>, s: &SizedVec<Num<Fr>, L>, y: &SizedVec<Num<Fr>, L>) -> SnarkInfo<E> {
    |                     ^                     ^                     ^                         ^
...
111 |         let r: Num<Fr> = rng.gen();
    |             ^
...
129 |         let v = s.iter()
    |             ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names

warning: redundant field names in struct initialization
   --> src/zk/sip.rs:149:13
    |
149 |             inputs: inputs,
    |             ^^^^^^^^^^^^^^ help: replace it with: `inputs`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: using `clone` on type `miracl_core::bls12381::big::BIG` which implements the `Copy` trait
  --> src/math/matrix.rs:40:22
   |
40 |             modulus: modulus.clone()
   |                      ^^^^^^^^^^^^^^^ help: try dereferencing it: `*modulus`
   |
   = note: `#[warn(clippy::clone_on_copy)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: using `clone` on type `miracl_core::bls12381::big::BIG` which implements the `Copy` trait
  --> src/math/matrix.rs:55:22
   |
55 |             modulus: modulus.clone()
   |                      ^^^^^^^^^^^^^^^ help: try dereferencing it: `*modulus`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: using `clone` on type `miracl_core::bls12381::big::BIG` which implements the `Copy` trait
  --> src/math/matrix.rs:69:22
   |
69 |             modulus: modulus.clone()
   |                      ^^^^^^^^^^^^^^^ help: try dereferencing it: `*modulus`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: you should consider adding a `Default` implementation for `math::matrix::BigNumMatrix2x2`
   --> src/math/matrix.rs:121:5
    |
121 | /     pub fn new() -> Self {
122 | |         Self {
123 | |             data: vec![BigNum::new(); 2 * 2],
124 | |         }
125 | |     }
    | |_____^
    |
    = note: `#[warn(clippy::new_without_default)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try this
    |
120 | impl Default for math::matrix::BigNumMatrix2x2 {
121 |     fn default() -> Self {
122 |         Self::new()
123 |     }
124 | }
    |

warning: you should consider adding a `Default` implementation for `math::matrix::BigIntMatrix2x2`
   --> src/math/matrix.rs:277:5
    |
277 | /     pub fn new() -> Self {
278 | |         Self {
279 | |             data: vec![BigInt::from(0); 2 * 2],
280 | |         }
281 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try this
    |
276 | impl Default for math::matrix::BigIntMatrix2x2 {
277 |     fn default() -> Self {
278 |         Self::new()
279 |     }
280 | }
    |

warning: you should consider adding a `Default` implementation for `utils::rand_utils::RandUtilsRAND`
  --> src/utils/rand_utils.rs:32:5
   |
32 | /     pub fn new() -> Self {
33 | |         Self {
34 | |             rng: Self::get_rng()
35 | |         }
36 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try this
   |
31 | impl Default for utils::rand_utils::RandUtilsRAND {
32 |     fn default() -> Self {
33 |         Self::new()
34 |     }
35 | }
   |

warning: unneeded `return` statement
  --> src/utils/rand_utils.rs:46:9
   |
46 |         return Self::get_seeded_rng(&seed);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `Self::get_seeded_rng(&seed)`
   |
   = note: `#[warn(clippy::needless_return)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

warning: you should consider adding a `Default` implementation for `utils::rand_utils::RandUtilsRng`
  --> src/utils/rand_utils.rs:95:5
   |
95 | /     pub fn new() -> Self {
96 | |         Self {
97 | |             rng: Self::get_rng()
98 | |         }
99 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try this
   |
94 | impl Default for utils::rand_utils::RandUtilsRng {
95 |     fn default() -> Self {
96 |         Self::new()
97 |     }
98 | }
   |

warning: unneeded `return` statement
   --> src/utils/rand_utils.rs:106:9
    |
106 |         return StdRng::from_entropy();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `StdRng::from_entropy()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

warning: returning the result of a `let` binding from a block
   --> src/utils/rand_utils.rs:111:9
    |
110 |         let rng = StdRng::from_seed(*seed);
    |         ----------------------------------- unnecessary `let` binding
111 |         rng
    |         ^^^
    |
    = note: `#[warn(clippy::let_and_return)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
    |
110 |         
111 |         StdRng::from_seed(*seed)
    |

warning: manual implementation of an assign operation
  --> src/utils/mod.rs:54:9
   |
54 |         y = y + m;
   |         ^^^^^^^^^ help: replace it with: `y += m`
   |
   = note: `#[warn(clippy::assign_op_pattern)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern

warning: manual implementation of an assign operation
   --> src/utils/mod.rs:195:9
    |
195 |         res = res + tmp;
    |         ^^^^^^^^^^^^^^^ help: replace it with: `res += tmp`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern

warning: the loop variable `i` is used to index `x`
   --> src/utils/mod.rs:205:14
    |
205 |     for i in 0..x.len() {
    |              ^^^^^^^^^^
    |
    = note: `#[warn(clippy::needless_range_loop)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
205 |     for (i, <item>) in x.iter().enumerate() {
    |         ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `j` is used to index `y`
   --> src/utils/mod.rs:206:18
    |
206 |         for j in 0..y.len() {
    |                  ^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
206 |         for (j, <item>) in y.iter().enumerate() {
    |             ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^

warning: manual implementation of an assign operation
   --> src/utils/mod.rs:209:13
    |
209 |             res = res + tmp;
    |             ^^^^^^^^^^^^^^^ help: replace it with: `res += tmp`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern

warning: the loop variable `i` is used to index `fe_key`
   --> src/dmcfe_ip.rs:110:22
    |
110 |             for i in 0..2 {
    |                      ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
110 |             for (i, <item>) in fe_key.iter_mut().enumerate().take(2) {
    |                 ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `i` is used to index `pub_keys`
   --> src/dmcfe_ip.rs:199:18
    |
199 |         for i in 0..pub_keys.len() {
    |                  ^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
199 |         for (i, <item>) in pub_keys.iter().enumerate() {
    |             ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `i` is only used to index `x`.
   --> src/dmcfe_ip.rs:257:18
    |
257 |         for i in 0..x.len() {
    |                  ^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
257 |         for <item> in &x {
    |             ^^^^^^    ^^

warning: the loop variable `i` is used to index `hs`
   --> src/dmcfe_ip.rs:279:18
    |
279 |         for i in 0..2 {
    |                  ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
279 |         for (i, <item>) in hs.iter_mut().enumerate().take(2) {
    |             ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `i` is used to index `fe_key_share`
   --> src/dmcfe_ip.rs:288:18
    |
288 |         for i in 0..2 {
    |                  ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
288 |         for (i, <item>) in fe_key_share.iter_mut().enumerate().take(2) {
    |             ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `j` is used to index `hs`
   --> src/dmcfe_ip.rs:290:22
    |
290 |             for j in 0..2 {
    |                      ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
290 |             for (j, <item>) in hs.iter().enumerate().take(2) {
    |                 ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `i` is only used to index `keys_sum`.
   --> src/dmcfe_ip.rs:317:18
    |
317 |         for i in 0..2 {
    |                  ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
317 |         for <item> in keys_sum.iter_mut().take(2) {
    |             ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `j` is used to index `keys_sum`
   --> src/dmcfe_ip.rs:322:22
    |
322 |             for j in 0..2 {
    |                      ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
322 |             for (j, <item>) in keys_sum.iter_mut().enumerate().take(2) {
    |                 ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices.
   --> src/dmcfe_ip.rs:347:18
    |
347 |         ciphers: &G1Vector,
    |                  ^^^^^^^^^
    |
    = note: `#[warn(clippy::ptr_arg)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

warning: the loop variable `i` is used to index `ciphers`
   --> src/dmcfe_ip.rs:359:18
    |
359 |         for i in 0..L {
    |                  ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
359 |         for (i, <item>) in ciphers.iter().enumerate().take(L) {
    |             ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: using `clone` on type `miracl_core::bls12381::big::BIG` which implements the `Copy` trait
   --> src/dmcfe_ip.rs:360:28
    |
360 |             let mut temp = dk.y[i].clone(); 
    |                            ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `dk.y[i]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: you should consider adding a `Default` implementation for `ml::disease_prediction::DiseasePrediction<'a>`
  --> src/ml/disease_prediction.rs:29:5
   |
29 | /     pub fn new() -> Self {
30 | |         let y1: [f32; 8] = [0.34362, 2.63588, 1.8803, 1.12673, -0.90941, 0.59397, 0.5232, 0.68602];
31 | |         let y2: [f32; 8] = [0.48123, 3.39222, 1.39862, -0.00439, 0.16081, 0.99858, 0.19035, 0.49756];
32 | |         let fe = Dmcfe::<8>::new();
...  |
43 | |         }
44 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try this
   |
19 | impl Default for ml::disease_prediction::DiseasePrediction<'a> {
20 |     fn default() -> Self {
21 |         Self::new()
22 |     }
23 | }
   |

warning: returning the result of a `let` binding from a block
  --> src/ml/disease_prediction.rs:62:9
   |
61 |         let ciphers = self.fe.encrypt(&int_x);
   |         -------------------------------------- unnecessary `let` binding
62 |         ciphers
   |         ^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
   |
61 |         
62 |         self.fe.encrypt(&int_x)
   |

warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices.
  --> src/ml/disease_prediction.rs:73:36
   |
73 |     pub fn compute(&self, ciphers: &G1Vector) -> Vec<f32> {
   |                                    ^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices.
  --> src/ml/neural_network.rs:40:37
   |
40 |     pub fn new(p: &BigIntMatrix, q: &Vec<BigIntMatrix>) -> Self {
   |                                     ^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
help: change this to
   |
40 |     pub fn new(p: &BigIntMatrix, q: &[BigIntMatrix]) -> Self {
   |                                     ^^^^^^^^^^^^^^^
help: change `q.clone()` to
   |
45 |             q: q.to_owned(),
   |                ^^^^^^^^^^^^

warning: returning the result of a `let` binding from a block
  --> src/ml/neural_network.rs:64:9
   |
63 |         let cipher = self.sgp.encrypt(&plain);
   |         -------------------------------------- unnecessary `let` binding
64 |         cipher
   |         ^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
   |
63 |         
64 |         self.sgp.encrypt(&plain)
   |

warning: returning the result of a `let` binding from a block
  --> src/zk/dlog.rs:28:5
   |
26 |     let signal_y = g.mul(&signal_x_bits, params);
   |     --------------------------------------------- unnecessary `let` binding
27 | 
28 |     signal_y
   |     ^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
   |
26 |     
27 | 
28 |     g.mul(&signal_x_bits, params)
   |

warning: using `clone` on type `fawkes_crypto::native::ecc::EdwardsPoint<fawkes_crypto::engines::bn256::Fr>` which implements the `Copy` trait
   --> src/zk/qp.rs:143:17
    |
143 |             g1: g1.clone(),
    |                 ^^^^^^^^^^ help: try dereferencing it: `*g1`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: using `clone` on type `fawkes_crypto::native::ecc::EdwardsPoint<fawkes_crypto::engines::bn256::Fr>` which implements the `Copy` trait
   --> src/zk/qp.rs:144:17
    |
144 |             h1: h1.clone(),
    |                 ^^^^^^^^^^ help: try dereferencing it: `*h1`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: manual implementation of an assign operation
   --> src/zk/sip.rs:123:13
    |
123 |             ys = ys + (y[i] * s[i]);
    |             ^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `ys += (y[i] * s[i])`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern

warning: using `clone` on type `fawkes_crypto::native::ecc::EdwardsPoint<fawkes_crypto::engines::bn256::Fr>` which implements the `Copy` trait
   --> src/zk/sip.rs:134:16
    |
134 |             g: g.clone(),
    |                ^^^^^^^^^ help: try dereferencing it: `*g`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: using `clone` on type `fawkes_crypto::native::ecc::EdwardsPoint<fawkes_crypto::engines::bn256::Fr>` which implements the `Copy` trait
   --> src/zk/sip.rs:135:16
    |
135 |             h: h.clone(),
    |                ^^^^^^^^^ help: try dereferencing it: `*h`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: 55 warnings emitted

    Finished dev [unoptimized + debuginfo] target(s) in 0.03s

@lornacrevelingwgo23
Copy link
Copy Markdown

Would you mind telling me exactly what type of operating system and rust version you are currently running?

Ubuntu 20.04 cargo 1.51.0 (43b129a20 2021-03-16)

Here's the output for completeness:

❯ cargo clippy
warning: name `GT` contains a capitalized acronym
  --> src/define.rs:16:10
   |
16 | pub type GT = FP12;
   |          ^^ help: consider making the acronym lowercase, except the initial letter: `Gt`
   |
   = note: `#[warn(clippy::upper_case_acronyms)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `RandUtilsRAND` contains a capitalized acronym
  --> src/utils/rand_utils.rs:26:12
   |
26 | pub struct RandUtilsRAND {
   |            ^^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `RandUtilsRand`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: 7 bindings with single-character names in scope
  --> src/utils/mod.rs:61:29
   |
61 | pub fn baby_step_giant_step(h: &GT, g: &GT, bound: &BigNum) -> Option<BigInt> {
   |                             ^       ^
...
69 |     let b = BigInt::from_str_radix(&bound.tostring(), 16).unwrap();
   |         ^
...
72 |     let m = BigNum::fromstring(temp.to_str_radix(16));
   |         ^
...
75 |     let (mut x, mut z) = (GT::new(), GT::new_copy(&g));
   |              ^      ^
76 |     let mut i = BigNum::new_int(0);
   |             ^
   |
   = note: `#[warn(clippy::many_single_char_names)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names

warning: 7 bindings with single-character names in scope
  --> src/utils/mod.rs:61:29
   |
61 | pub fn baby_step_giant_step(h: &GT, g: &GT, bound: &BigNum) -> Option<BigInt> {
   |                             ^       ^
...
69 |     let b = BigInt::from_str_radix(&bound.tostring(), 16).unwrap();
   |         ^
...
72 |     let m = BigNum::fromstring(temp.to_str_radix(16));
   |         ^
...
75 |     let (mut x, mut z) = (GT::new(), GT::new_copy(&g));
   |              ^      ^
76 |     let mut i = BigNum::new_int(0);
   |             ^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names

warning: 7 bindings with single-character names in scope
   --> src/utils/mod.rs:127:32
    |
127 | pub fn baby_step_giant_step_g1(h: &G1, g: &G1, bound: &BigNum) -> Option<BigInt> {
    |                                ^       ^
...
134 |     let b = BigInt::from_str_radix(&bound.tostring(), 16).unwrap();
    |         ^
...
137 |     let m = BigNum::fromstring(temp.to_str_radix(16));
    |         ^
...
140 |     let (mut x, mut z) = (G1::new(), g.clone());
    |              ^      ^
141 |     let mut i = BigNum::new_int(0);
    |             ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names

warning: 5 bindings with single-character names in scope
   --> src/quadratic_sgp.rs:103:14
    |
103 |         let (x, y) = (&plain.x, &plain.y);
    |              ^  ^
...
110 |         let w = BigNumMatrix2x2::new_random(&(CURVE_ORDER));
    |             ^
...
118 |         let mut a: G1Vector = vec![G1::generator(); L * 2];
    |                 ^
119 |         let mut b: G2Vector = vec![G2::generator(); L * 2];
    |                 ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names

warning: name `JJParams` contains a capitalized acronym
  --> src/zk/dlog.rs:21:6
   |
21 | type JJParams = JubJubBN256;
   |      ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `JjParams`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: redundant field names in struct initialization
  --> src/zk/dlog.rs:59:13
   |
59 |             inputs: inputs,
   |             ^^^^^^^^^^^^^^ help: replace it with: `inputs`
   |
   = note: `#[warn(clippy::redundant_field_names)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: name `JJParams` contains a capitalized acronym
  --> src/zk/qp.rs:29:6
   |
29 | type JJParams = JubJubBN256;
   |      ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `JjParams`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `QPProofPublic` contains a capitalized acronym
  --> src/zk/qp.rs:33:12
   |
33 | pub struct QPProofPublic<Fr: PrimeField, const L: usize> {
   |            ^^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `QpProofPublic`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `CQPProofPublic` contains a capitalized acronym
  --> src/zk/qp.rs:44:12
   |
44 | pub struct CQPProofPublic<C: CS, const L: usize> {
   |            ^^^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `CqpProofPublic`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `QPProofSecret` contains a capitalized acronym
  --> src/zk/qp.rs:54:12
   |
54 | pub struct QPProofSecret<Fr: PrimeField, const L: usize> {
   |            ^^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `QpProofSecret`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `CQPProofSecret` contains a capitalized acronym
  --> src/zk/qp.rs:63:12
   |
63 | pub struct CQPProofSecret<C: CS, const L: usize> {
   |            ^^^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `CqpProofSecret`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: redundant field names in struct initialization
   --> src/zk/qp.rs:160:13
    |
160 |             inputs: inputs,
    |             ^^^^^^^^^^^^^^ help: replace it with: `inputs`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: name `JJParams` contains a capitalized acronym
  --> src/zk/sip.rs:24:6
   |
24 | type JJParams = JubJubBN256;
   |      ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `JjParams`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: 5 bindings with single-character names in scope
   --> src/zk/sip.rs:107:21
    |
107 |     pub fn generate(g: &EdwardsPoint<Fr>, h: &EdwardsPoint<Fr>, s: &SizedVec<Num<Fr>, L>, y: &SizedVec<Num<Fr>, L>) -> SnarkInfo<E> {
    |                     ^                     ^                     ^                         ^
...
111 |         let r: Num<Fr> = rng.gen();
    |             ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names

warning: 6 bindings with single-character names in scope
   --> src/zk/sip.rs:107:21
    |
107 |     pub fn generate(g: &EdwardsPoint<Fr>, h: &EdwardsPoint<Fr>, s: &SizedVec<Num<Fr>, L>, y: &SizedVec<Num<Fr>, L>) -> SnarkInfo<E> {
    |                     ^                     ^                     ^                         ^
...
111 |         let r: Num<Fr> = rng.gen();
    |             ^
...
129 |         let v = s.iter()
    |             ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names

warning: redundant field names in struct initialization
   --> src/zk/sip.rs:149:13
    |
149 |             inputs: inputs,
    |             ^^^^^^^^^^^^^^ help: replace it with: `inputs`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: using `clone` on type `miracl_core::bls12381::big::BIG` which implements the `Copy` trait
  --> src/math/matrix.rs:40:22
   |
40 |             modulus: modulus.clone()
   |                      ^^^^^^^^^^^^^^^ help: try dereferencing it: `*modulus`
   |
   = note: `#[warn(clippy::clone_on_copy)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: using `clone` on type `miracl_core::bls12381::big::BIG` which implements the `Copy` trait
  --> src/math/matrix.rs:55:22
   |
55 |             modulus: modulus.clone()
   |                      ^^^^^^^^^^^^^^^ help: try dereferencing it: `*modulus`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: using `clone` on type `miracl_core::bls12381::big::BIG` which implements the `Copy` trait
  --> src/math/matrix.rs:69:22
   |
69 |             modulus: modulus.clone()
   |                      ^^^^^^^^^^^^^^^ help: try dereferencing it: `*modulus`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: you should consider adding a `Default` implementation for `math::matrix::BigNumMatrix2x2`
   --> src/math/matrix.rs:121:5
    |
121 | /     pub fn new() -> Self {
122 | |         Self {
123 | |             data: vec![BigNum::new(); 2 * 2],
124 | |         }
125 | |     }
    | |_____^
    |
    = note: `#[warn(clippy::new_without_default)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try this
    |
120 | impl Default for math::matrix::BigNumMatrix2x2 {
121 |     fn default() -> Self {
122 |         Self::new()
123 |     }
124 | }
    |

warning: you should consider adding a `Default` implementation for `math::matrix::BigIntMatrix2x2`
   --> src/math/matrix.rs:277:5
    |
277 | /     pub fn new() -> Self {
278 | |         Self {
279 | |             data: vec![BigInt::from(0); 2 * 2],
280 | |         }
281 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try this
    |
276 | impl Default for math::matrix::BigIntMatrix2x2 {
277 |     fn default() -> Self {
278 |         Self::new()
279 |     }
280 | }
    |

warning: you should consider adding a `Default` implementation for `utils::rand_utils::RandUtilsRAND`
  --> src/utils/rand_utils.rs:32:5
   |
32 | /     pub fn new() -> Self {
33 | |         Self {
34 | |             rng: Self::get_rng()
35 | |         }
36 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try this
   |
31 | impl Default for utils::rand_utils::RandUtilsRAND {
32 |     fn default() -> Self {
33 |         Self::new()
34 |     }
35 | }
   |

warning: unneeded `return` statement
  --> src/utils/rand_utils.rs:46:9
   |
46 |         return Self::get_seeded_rng(&seed);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `Self::get_seeded_rng(&seed)`
   |
   = note: `#[warn(clippy::needless_return)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

warning: you should consider adding a `Default` implementation for `utils::rand_utils::RandUtilsRng`
  --> src/utils/rand_utils.rs:95:5
   |
95 | /     pub fn new() -> Self {
96 | |         Self {
97 | |             rng: Self::get_rng()
98 | |         }
99 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try this
   |
94 | impl Default for utils::rand_utils::RandUtilsRng {
95 |     fn default() -> Self {
96 |         Self::new()
97 |     }
98 | }
   |

warning: unneeded `return` statement
   --> src/utils/rand_utils.rs:106:9
    |
106 |         return StdRng::from_entropy();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `StdRng::from_entropy()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

warning: returning the result of a `let` binding from a block
   --> src/utils/rand_utils.rs:111:9
    |
110 |         let rng = StdRng::from_seed(*seed);
    |         ----------------------------------- unnecessary `let` binding
111 |         rng
    |         ^^^
    |
    = note: `#[warn(clippy::let_and_return)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
    |
110 |         
111 |         StdRng::from_seed(*seed)
    |

warning: manual implementation of an assign operation
  --> src/utils/mod.rs:54:9
   |
54 |         y = y + m;
   |         ^^^^^^^^^ help: replace it with: `y += m`
   |
   = note: `#[warn(clippy::assign_op_pattern)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern

warning: manual implementation of an assign operation
   --> src/utils/mod.rs:195:9
    |
195 |         res = res + tmp;
    |         ^^^^^^^^^^^^^^^ help: replace it with: `res += tmp`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern

warning: the loop variable `i` is used to index `x`
   --> src/utils/mod.rs:205:14
    |
205 |     for i in 0..x.len() {
    |              ^^^^^^^^^^
    |
    = note: `#[warn(clippy::needless_range_loop)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
205 |     for (i, <item>) in x.iter().enumerate() {
    |         ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `j` is used to index `y`
   --> src/utils/mod.rs:206:18
    |
206 |         for j in 0..y.len() {
    |                  ^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
206 |         for (j, <item>) in y.iter().enumerate() {
    |             ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^

warning: manual implementation of an assign operation
   --> src/utils/mod.rs:209:13
    |
209 |             res = res + tmp;
    |             ^^^^^^^^^^^^^^^ help: replace it with: `res += tmp`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern

warning: the loop variable `i` is used to index `fe_key`
   --> src/dmcfe_ip.rs:110:22
    |
110 |             for i in 0..2 {
    |                      ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
110 |             for (i, <item>) in fe_key.iter_mut().enumerate().take(2) {
    |                 ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `i` is used to index `pub_keys`
   --> src/dmcfe_ip.rs:199:18
    |
199 |         for i in 0..pub_keys.len() {
    |                  ^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
199 |         for (i, <item>) in pub_keys.iter().enumerate() {
    |             ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `i` is only used to index `x`.
   --> src/dmcfe_ip.rs:257:18
    |
257 |         for i in 0..x.len() {
    |                  ^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
257 |         for <item> in &x {
    |             ^^^^^^    ^^

warning: the loop variable `i` is used to index `hs`
   --> src/dmcfe_ip.rs:279:18
    |
279 |         for i in 0..2 {
    |                  ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
279 |         for (i, <item>) in hs.iter_mut().enumerate().take(2) {
    |             ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `i` is used to index `fe_key_share`
   --> src/dmcfe_ip.rs:288:18
    |
288 |         for i in 0..2 {
    |                  ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
288 |         for (i, <item>) in fe_key_share.iter_mut().enumerate().take(2) {
    |             ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `j` is used to index `hs`
   --> src/dmcfe_ip.rs:290:22
    |
290 |             for j in 0..2 {
    |                      ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
290 |             for (j, <item>) in hs.iter().enumerate().take(2) {
    |                 ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `i` is only used to index `keys_sum`.
   --> src/dmcfe_ip.rs:317:18
    |
317 |         for i in 0..2 {
    |                  ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
317 |         for <item> in keys_sum.iter_mut().take(2) {
    |             ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the loop variable `j` is used to index `keys_sum`
   --> src/dmcfe_ip.rs:322:22
    |
322 |             for j in 0..2 {
    |                      ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
322 |             for (j, <item>) in keys_sum.iter_mut().enumerate().take(2) {
    |                 ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices.
   --> src/dmcfe_ip.rs:347:18
    |
347 |         ciphers: &G1Vector,
    |                  ^^^^^^^^^
    |
    = note: `#[warn(clippy::ptr_arg)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

warning: the loop variable `i` is used to index `ciphers`
   --> src/dmcfe_ip.rs:359:18
    |
359 |         for i in 0..L {
    |                  ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
    |
359 |         for (i, <item>) in ciphers.iter().enumerate().take(L) {
    |             ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: using `clone` on type `miracl_core::bls12381::big::BIG` which implements the `Copy` trait
   --> src/dmcfe_ip.rs:360:28
    |
360 |             let mut temp = dk.y[i].clone(); 
    |                            ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `dk.y[i]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: you should consider adding a `Default` implementation for `ml::disease_prediction::DiseasePrediction<'a>`
  --> src/ml/disease_prediction.rs:29:5
   |
29 | /     pub fn new() -> Self {
30 | |         let y1: [f32; 8] = [0.34362, 2.63588, 1.8803, 1.12673, -0.90941, 0.59397, 0.5232, 0.68602];
31 | |         let y2: [f32; 8] = [0.48123, 3.39222, 1.39862, -0.00439, 0.16081, 0.99858, 0.19035, 0.49756];
32 | |         let fe = Dmcfe::<8>::new();
...  |
43 | |         }
44 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try this
   |
19 | impl Default for ml::disease_prediction::DiseasePrediction<'a> {
20 |     fn default() -> Self {
21 |         Self::new()
22 |     }
23 | }
   |

warning: returning the result of a `let` binding from a block
  --> src/ml/disease_prediction.rs:62:9
   |
61 |         let ciphers = self.fe.encrypt(&int_x);
   |         -------------------------------------- unnecessary `let` binding
62 |         ciphers
   |         ^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
   |
61 |         
62 |         self.fe.encrypt(&int_x)
   |

warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices.
  --> src/ml/disease_prediction.rs:73:36
   |
73 |     pub fn compute(&self, ciphers: &G1Vector) -> Vec<f32> {
   |                                    ^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices.
  --> src/ml/neural_network.rs:40:37
   |
40 |     pub fn new(p: &BigIntMatrix, q: &Vec<BigIntMatrix>) -> Self {
   |                                     ^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
help: change this to
   |
40 |     pub fn new(p: &BigIntMatrix, q: &[BigIntMatrix]) -> Self {
   |                                     ^^^^^^^^^^^^^^^
help: change `q.clone()` to
   |
45 |             q: q.to_owned(),
   |                ^^^^^^^^^^^^

warning: returning the result of a `let` binding from a block
  --> src/ml/neural_network.rs:64:9
   |
63 |         let cipher = self.sgp.encrypt(&plain);
   |         -------------------------------------- unnecessary `let` binding
64 |         cipher
   |         ^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
   |
63 |         
64 |         self.sgp.encrypt(&plain)
   |

warning: returning the result of a `let` binding from a block
  --> src/zk/dlog.rs:28:5
   |
26 |     let signal_y = g.mul(&signal_x_bits, params);
   |     --------------------------------------------- unnecessary `let` binding
27 | 
28 |     signal_y
   |     ^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
   |
26 |     
27 | 
28 |     g.mul(&signal_x_bits, params)
   |

warning: using `clone` on type `fawkes_crypto::native::ecc::EdwardsPoint<fawkes_crypto::engines::bn256::Fr>` which implements the `Copy` trait
   --> src/zk/qp.rs:143:17
    |
143 |             g1: g1.clone(),
    |                 ^^^^^^^^^^ help: try dereferencing it: `*g1`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: using `clone` on type `fawkes_crypto::native::ecc::EdwardsPoint<fawkes_crypto::engines::bn256::Fr>` which implements the `Copy` trait
   --> src/zk/qp.rs:144:17
    |
144 |             h1: h1.clone(),
    |                 ^^^^^^^^^^ help: try dereferencing it: `*h1`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: manual implementation of an assign operation
   --> src/zk/sip.rs:123:13
    |
123 |             ys = ys + (y[i] * s[i]);
    |             ^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `ys += (y[i] * s[i])`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern

warning: using `clone` on type `fawkes_crypto::native::ecc::EdwardsPoint<fawkes_crypto::engines::bn256::Fr>` which implements the `Copy` trait
   --> src/zk/sip.rs:134:16
    |
134 |             g: g.clone(),
    |                ^^^^^^^^^ help: try dereferencing it: `*g`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: using `clone` on type `fawkes_crypto::native::ecc::EdwardsPoint<fawkes_crypto::engines::bn256::Fr>` which implements the `Copy` trait
   --> src/zk/sip.rs:135:16
    |
135 |             h: h.clone(),
    |                ^^^^^^^^^ help: try dereferencing it: `*h`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

warning: 55 warnings emitted

    Finished dev [unoptimized + debuginfo] target(s) in 0.03s

@semuelle Thanks for your prompt response. Please check the updated repo. We have fixed 30+ warnings, but the remaining clippy warnings are mainly about the issues that we would prefer to stay as they are, such as “loop variable i is used to index ***” and “writing &Vec<> instead of &[]” etc. It would make more sense to us to keep the relevant code (e.g., the loop variable is used to index multiple arrays, some of which are even multi-dimensional) unchanged, instead of fixing them according to the warnings one-by-one. Please let us know if you definitely want us to remove all the remaining warnings. We can definitely try to restructure the code although we think it might make the code a bit less readable.

@semuelle
Copy link
Copy Markdown
Contributor

Thanks for the quick response. There is no need to follow the clippy suggestions/settings to a T if the deviations are justified.

Lastly, could you address musicarroll's comments here and here? Unless you already have and I missed it?

@lornacrevelingwgo23
Copy link
Copy Markdown

lornacrevelingwgo23 commented Oct 21, 2021

@rubyprotocol @mmagician @Lederstrumpf The benchmarks report lists three Schemes but does not indicate which tests these schemes correlate too. I've guessing the first two are inner product and quadratic, but the third scheme may be disease prediction or neural network. Please document which schemes are meant by each of the three benchmark runs.

@musicarroll Please check the updated readme for the concrete schemes of the benchmark results. We didn't show the results for the disease prediction here since they are entirely determined by the performance of the underlying algorithms.

Also, it would be useful to know how these benchmark results compare with previously run benchmarks for the C implementations. The computation times seem to scale almost linearly with the vector size, but I would expect this to ultimately have an asymptote. Finally, what size vectors do you anticipate for various Ruby data monetization use cases?

Yes, it is correct that the computation time scales linearly with the vector size, and the vector size for real-world data monetization would very much depend on the concrete use cases. For instance, the vector size for CVD prediction is around 8, and that of MNIST dataset is close to 1000 according to our reference paper.

@lornacrevelingwgo23
Copy link
Copy Markdown

@rubyprotocol @mmagician Since the FE components are basically a rewrite in Rust of the previous C implementation, wouldn't it make sense to re-use some of the same validation tests that were used on the C implementation to ensure that the same results are obtained?

We use randomly generated test data (as in the previous C implementation test), and basically have the same test results as the C-implementation, and validate the test results by comparing to the plaintext computation as in the C-implementation.

@lornacrevelingwgo23
Copy link
Copy Markdown

Thanks for the quick response. There is no need to follow the clippy suggestions/settings to a T if the deviations are justified.

Lastly, could you address musicarroll's comments here and here? Unless you already have and I missed it?

Sorry for the omission. Already answer the two questions in here and here.

@semuelle
Copy link
Copy Markdown
Contributor

Thanks for the quick replies and fixes, @lornacrevelingwgo23. Your milestone is hereby accepted. Here are the evaluation notes.

I will forward your invoice for processing.

@semuelle semuelle merged commit 572bf1d into w3f:master Oct 22, 2021
@RouvenP
Copy link
Copy Markdown

RouvenP commented Oct 22, 2021

hi @lornacrevelingwgo23. The payment is transferred.

@lornacrevelingwgo23
Copy link
Copy Markdown

hi @lornacrevelingwgo23. The payment is transferred.

Thanks a lot.

Thanks for the quick replies and fixes, @lornacrevelingwgo23. Your milestone is hereby accepted. Here are the evaluation notes.

I will forward your invoice for processing.

Many thanks for your prompt and very helpful comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants