poanetwork / threshold_crypto

A pairing-based threshold cryptosystem for collaborative decryption and signatures used in HoneybadgerBFT implementation
Other
191 stars 72 forks source link

Don’t allow calling `reveal` in release builds #66

Open DemiMarie opened 6 years ago

DemiMarie commented 6 years ago

Some structs have a reveal method, which deliberately leaks secret information for debug builds. There is no legitimate reason to use them for anything other than debugging, and no uses at all in any of the other codebases I am working on.

To ensure that no new uses of this method are added, make this method only available when debug assertions are turned on. This ensures that any attempts to uses this method will break release builds, and thus be quickly discovered.

DemiMarie commented 6 years ago

CI failure is due to:

  1. changes to lints in newer versions of Clippy
  2. Changes to rustfmt.

I will fix both.

Edit: It seems that we cannot fix both, since at least rustfmt has changed between stable and beta.

c0gent commented 6 years ago

I'm glad we take advantage of the massive productivity gains offered by clippy and rustfmt :)

/sarcasm off

afck commented 6 years ago

That's weird. I can't reproduce that locally; also, the "pr" build passed, and only the "push" one failed. For some reason, the latter called

rustup toolchain install ${RUST_NEXT}

and the former didn't. Is it using Rust nightly or beta for some reason??

afck commented 6 years ago

Maybe you just need to rebase? The no_leak_in_release_builds branch seems to have an outdated .travis.yml.