rust-secp256k1-unsafe-fast/src
Andrew Poelstra 7a3736a0f9
Merge rust-bitcoin/rust-secp256k1#389: On key-generation example (documentation), "rand" should be "rand-std" instead
2732891359 Change rand to rand-std in lib.rs documentation (Vincent Liao)

Pull request description:

  I copy-pasted the key-generation example written on the documentation, but it didn't work. It only worked when I used the feature `rand-std` instead of `rand`.

  To reproduce, boot up a new Rust project, and add this to main.rs:

  ```
  use secp256k1::rand::rngs::OsRng;
  use secp256k1::{Secp256k1, Message};
  use secp256k1::hashes::sha256;

  let secp = Secp256k1::new();
  let mut rng = OsRng::new().expect("OsRng");
  let (secret_key, public_key) = secp.generate_keypair(&mut rng);
  let message = Message::from_hashed_data::<sha256::Hash>("Hello World!".as_bytes());

  let sig = secp.sign_ecdsa(&message, &secret_key);
  assert!(secp.verify_ecdsa(&message, &sig, &public_key).is_ok());
  ```

  Using this dependencies causes error: `secp256k1 = {version="0.21.2", features=["rand", "bitcoin_hashes"]}`. After replacing `rand` with `rand-std`, it works.

ACKs for top commit:
  apoelstra:
    ACK 2732891
  tcharding:
    tACK 2732891359

Tree-SHA512: 6b5436bc71bab7535e432e119679bc6bcb11d2575b609e039cc25c122ae92b528f95a673e9c643a6cfa2ee3a663f7efdd61731b6084261c52a220448b6f72d12
2022-02-03 15:10:37 +00:00
..
ecdsa Enable running tests without default features 2022-02-01 15:20:44 +11:00
constants.rs Add schnorrsig module 2020-11-10 13:43:34 +09:00
context.rs Enable running tests without default features 2022-02-01 15:20:44 +11:00
ecdh.rs Enable running tests without default features 2022-02-01 15:20:44 +11:00
key.rs Fix typo 'epected' -> 'expected' 2022-02-03 08:36:36 +11:00
lib.rs Merge rust-bitcoin/rust-secp256k1#389: On key-generation example (documentation), "rand" should be "rand-std" instead 2022-02-03 15:10:37 +00:00
macros.rs Dedicated display_secret fn for secret-containing types 2021-09-27 14:03:58 +02:00
schnorr.rs Fix typo 'epected' -> 'expected' 2022-02-03 08:36:36 +11:00
secret.rs Add multiple implementations of Debug for secrets 2022-02-01 14:51:40 +11:00
serde_util.rs Remove `visit_bytes` implementation from `FromStrVisitor` 2021-01-13 09:57:09 +11:00