mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-02-07 06:44:11 +00:00
parent
002173e187
commit
69ce66ae6c
@ -14,6 +14,6 @@ rand = "0.4"
|
|||||||
ff_derive = { version = "0.3.0", path = "ff_derive", optional = true }
|
ff_derive = { version = "0.3.0", path = "ff_derive", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["derive"]
|
default = []
|
||||||
u128-support = []
|
u128-support = []
|
||||||
derive = ["ff_derive"]
|
derive = ["ff_derive"]
|
||||||
|
@ -21,6 +21,15 @@ The `ff` crate contains `Field`, `PrimeField`, `PrimeFieldRepr` and `SqrtField`
|
|||||||
|
|
||||||
If you need an implementation of a prime field, this library also provides a procedural macro that will expand into an efficient implementation of a prime field when supplied with the modulus. `PrimeFieldGenerator` must be an element of Fp of p-1 order, that is also quadratic nonresidue.
|
If you need an implementation of a prime field, this library also provides a procedural macro that will expand into an efficient implementation of a prime field when supplied with the modulus. `PrimeFieldGenerator` must be an element of Fp of p-1 order, that is also quadratic nonresidue.
|
||||||
|
|
||||||
|
First, enable the `derive` crate feature:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[dependencies]
|
||||||
|
ff = { version = "0.3", features = ["derive"] }
|
||||||
|
```
|
||||||
|
|
||||||
|
And then use the macro like so:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
@ -3,9 +3,11 @@
|
|||||||
extern crate byteorder;
|
extern crate byteorder;
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
|
|
||||||
|
#[cfg(feature = "derive")]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate ff_derive;
|
extern crate ff_derive;
|
||||||
|
|
||||||
|
#[cfg(feature = "derive")]
|
||||||
pub use ff_derive::*;
|
pub use ff_derive::*;
|
||||||
|
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
Loading…
Reference in New Issue
Block a user