dalek-cryptography / bulletproofs

A pure-Rust implementation of Bulletproofs using Ristretto.
MIT License
1.02k stars 216 forks source link

Digest error #341

Closed Fiono11 closed 3 years ago

Fiono11 commented 3 years ago

Hello! When I try to do the following in the new version it gives me an error. Can you tell me why, please? Thanks!

let mut h = Sha512::new()
        .chain("Tstring");

let s = Scalar::from_hash(h);
WildCryptoFox commented 3 years ago

Please include your error. All I get is two warnings. h doesn't need to be mutable. s is unused.

warning: unused variable: `s`
 --> src/main.rs:8:9
  |
8 |     let s = Scalar::from_hash(h);
  |         ^ help: if this is intentional, prefix it with an underscore: `_s`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: variable does not need to be mutable
 --> src/main.rs:5:9
  |
5 |     let mut h = Sha512::new()
  |         ----^
  |         |
  |         help: remove this `mut`
  |
  = note: `#[warn(unused_mut)]` on by default
Fiono11 commented 3 years ago

I had an outdated version. Sorry, forgot to close the issue!