Jack Grigg
9114c367f4
ff_derive: Generate modulus representation with correct endianness
...
Now that PrimeField::ReprEndianness exists, users can obtain a
known-endianness representation from the output of PrimeField::char
(which is a PrimeField::Repr, and should return a representation with
the same endianness as PrimeField::into_repr).
2020-05-02 18:54:02 +12:00
Jack Grigg
15e229509a
ff: Move pow_vartime back into Field trait
...
The only places we don't use constant u64 limbs, we use PrimeField::char
instead (except in a single test where we use a field element).
2020-05-02 18:54:02 +12:00
Jack Grigg
fb31d09218
ff: Remove Ord bound from PrimeField
...
ff_derive still implements Ord and PartialOrd for the fields it
implements, because pairing::bls12_381 internally assumes that those are
implemented. Once we delete that implementation, we will remove the Ord
and PartialOrd implementations from ff_derive.
2020-05-02 18:54:02 +12:00
Jack Grigg
38f87c2e73
ff: Add PrimeField::ReprEndianness associated type
...
This enables generic code to reliably operate on the bits of an encoded
field element, by converting them to and from a known (little)
endianness.
The BitAnd and Shr bounds on PrimeField are now removed, as users can
perform these operations themselves as needed.
2020-05-02 18:54:02 +12:00
Jack Grigg
55568b4d6e
ff: Remove frobenius_map from Field trait
...
It is only used internally in the bls12_381 crate, and field extensions
aren't exposed anywhere in the Zcash stack.
2020-05-02 16:07:48 +12:00
Jack Grigg
1761ebfb35
ff: Remove SqrtField trait
...
The sqrt() function is now part of the Field trait. ff_derive returns an
error on fields for which it does not support generating a square root
function.
Note that Fq6 and Fq12 in pairing::bls12_381 leave the function
unimplemented. They will be dropped once the migration to the bls12_381
crate is complete. The equivalent structs in that crate are not exposed.
2020-05-02 16:07:48 +12:00
str4d
b02cf3b467
Merge pull request #223 from str4d/remove-primefieldrepr
...
Remove ff::PrimeFieldRepr
2020-05-01 08:59:41 +12:00
Jack Grigg
49f119fb03
ff: Remove PrimeFieldRepr trait
...
The ff::PrimeField::Repr associated type now has the minimal necessary
bounds, which can be satisfied by a newtype around a byte array.
2020-04-23 18:15:14 +12:00
Jack Grigg
1fe3e3784c
ff: Add Ord bound to PrimeField
2020-04-23 17:31:33 +12:00
Jack Grigg
1a40cfd39c
zcash_primitives: Make jubjub::Fs::invert constant time
2020-04-23 16:23:24 +12:00
Jack Grigg
08500ee712
ff: PrimeField: BitAnd<u64, Output = u64> + Shr<u32, Output = Self>
2020-04-23 16:23:24 +12:00
Jack Grigg
1fdca393bb
ff: PrimeField::{is_even, is_odd}
2020-04-23 16:23:24 +12:00
Jack Grigg
232f0a50b8
ff: Rework BitIterator to work with both u8 and u64 limb sizes
...
This enables BitIterator to be used with both the byte encoding and limb
representation of scalars.
2020-04-23 16:23:24 +12:00
Jack Grigg
fd79de5408
ff: Add PrimeField: From<u64> constraint
2020-04-23 16:23:24 +12:00
str4d
b82dac13d9
Merge pull request #221 from adityapk00/binding_sig
...
Add binding signature only if needed
2020-04-16 13:46:26 +12:00
Aditya Kulkarni
3ccadf3017
Add binding signature only if needed
2020-04-04 10:29:30 -07:00
Jack Grigg
b6457a905b
ff: Move pow_vartime into a trait that is generic over the limb size
...
The trait is implemented by default for u8 and u64, allowing pow_vartime
to be used with both the byte encoding and limb representation of field
elements.
2020-03-28 00:27:59 +13:00
Jack Grigg
69c60530d4
group: Rewrite wNAF to remove dependency on ff::PrimeFieldRepr
...
Adapted from Scalar::non_adjacent_form in curve25519-dalek.
2020-03-26 22:32:17 +13:00
Jack Grigg
6e53cf3c4c
group: Take scalar by reference in CurveProjective::recommended_wnaf_for_scalar
2020-03-26 19:00:46 +13:00
str4d
97c21e0c1a
Merge pull request #219 from str4d/remove-lockfile
...
Remove Cargo.lock
2020-03-26 07:54:05 +13:00
Jack Grigg
c1b5a80304
Add Cargo.lock to .gitignore
2020-03-25 17:24:50 +13:00
Jack Grigg
3cc32aacbc
Remove Cargo.lock
...
Now that the librustzcash crate has been removed from the repository and
workspace, there are no crates that generate binary artifacts, and cargo
ignores Cargo.lock when publishing library crates.
2020-03-25 17:19:27 +13:00
ebfull
ce39a3c48e
Merge pull request #196 from str4d/pow-fixed
...
Speed up Field::invert and SqrtField::sqrt in ff_derive with addition chains
2020-03-14 09:44:02 -06:00
str4d
8a737f5441
Merge pull request #218 from str4d/remove-librustzcash
...
Remove librustzcash crate
2020-03-14 16:08:22 +13:00
Jack Grigg
2942e9a7e6
Generate addition chains inside Field::invert and SqrtField::sqrt
2020-03-14 10:54:22 +13:00
Jack Grigg
232fb4b7a3
Procedural macro for fixed-exponent variable-base modular exponentiation
...
Uses the addchain crate to obtain an addition chain for the exponent,
and then generates the corresponding constant-time square-and-multiply
algorithm.
2020-03-14 10:54:22 +13:00
Jack Grigg
16ba891726
Remove librustzcash crate
...
This crate now lives in https://github.com/zcash/zcash , which is the
sole intended consumer of the C FFI.
2020-03-14 10:50:04 +13:00
Jack Grigg
2df2a2b2f2
Merge branch 'develop'
2020-03-14 10:36:58 +13:00
str4d
53bd5d4724
Merge pull request #216 from ebfull/crate-updates
...
Crate updates
2020-03-13 12:04:12 +13:00
Sean Bowe
100878cd14
Version bump of all crates (except librustzcash)
2020-03-12 15:59:19 -06:00
Sean Bowe
f3f8964001
Remove Sized for RngCore
...
Co-authored-by: Weiliang Li <to.be.impressive@gmail.com>
2020-03-12 15:32:44 -06:00
ebfull
d9ac7bd19b
Merge pull request #214 from ebfull/manifest-updates
...
Update manifest for zcash_history
2020-03-04 10:05:44 -07:00
Sean Bowe
0f0d84e9ca
Update manifest for zcash_history.
2020-03-04 09:28:56 -07:00
ebfull
49459d030f
Merge pull request #213 from str4d/zip-221-change
...
Update zcash_history with ZIP 221 change
2020-03-04 09:04:14 -07:00
Jack Grigg
cafbe61eba
Commit to number of Sapling transactions instead of shielded transactions
2020-03-04 18:25:35 +13:00
str4d
fc247fc898
Merge pull request #212 from ebfull/depends-updates-2
...
Dependency updates
2020-03-04 15:11:42 +13:00
Sean Bowe
46e88a5e69
cargo fmt
2020-03-03 18:14:44 -07:00
Sean Bowe
5e1a2f9d3f
Rename zcash_mmr to zcash_history.
...
This crate will contain all chain history logic.
2020-03-03 18:14:40 -07:00
Sean Bowe
9379eec1b8
Bring zcash_mmr into workspace.
2020-03-03 18:04:18 -07:00
Sean Bowe
4f0f10a53c
Add 'zcash_history/' from commit 'e2c131fdc308265adcab774e54d4d5804c23b368'
...
git-subtree-dir: zcash_history
git-subtree-mainline: be0ee9eb82
git-subtree-split: e2c131fdc3
2020-03-03 17:51:19 -07:00
Sean Bowe
be0ee9eb82
Changes to Cargo.lock to reflect upstream crate changes.
2020-03-03 17:49:24 -07:00
Sean Bowe
b52e4aac3a
Fix Field::random method declarations.
2020-03-03 17:47:29 -07:00
Sean Bowe
c49aaceb5d
Merge commit 'f337eb1f5c67d9305b1fb4fb35507bb50817259b' into depends-updates-2
2020-03-03 17:46:59 -07:00
Sean Bowe
f337eb1f5c
Squashed 'bellman/' changes from 4272cfa..2279da4
...
2279da4
Merge pull request #38 from debris/docs
2e57190
Remove documentation entry from Cargo.toml
346d540
bellman 0.2.0
8d79665
Merge pull request #93 from defuse/qed-it-lrz
f50079f
Crate docs
701cb2b
Update READMEs
ccf1ee9
CI: Check intra-doc links
ddd390a
Add READMEs to Cargo.toml files
54d3122
Add missing cs.is_satisfied() to bellman test
52bf23c
Fix build warnings
581ad35
boolean: adds tests for alloc_conditionally
0403396
blake2s: adds test vectors from go-jubjub
9f24e47
Fix blake2s test data length assertion.
42d5b3b
Add blake2s test vectors for varying sizes from go-jubjub
b2597de
pedersen_hash: removes debug prints
c903fad
pedersen hashes: example of size limit bug
bc697c1
bellman: Fix compile errors without multicore feature
a4e5df9
Upgrade to hex-literal 0.2
c063509
Migrate bellman to crossbeam 0.7
1775843
Take self directly in into_* functions
614d784
Rename into_ -> to_ where &self is used.
08664b1
Address various clippy warnings/errors in bellman
bb11ef2
cargo fmt
cff2e2f
cargo fix --edition-idioms for bellman
dc2a280
Add edition = 2018
1a2bc19
cargo fmt
ad37878
cargo fix --edition for bellman
e73d1a2
cargo fmt bellman
dfb86fc
Move generic circuit gadgets into bellman
9b3d766
Migrate to rand 0.7
055280f
Migrate ff, group, pairing, and bellman to rand 0.6
533d586
Migrate bellman to rand 0.5
bfa9aaf
Merge pull request #61 from rex4539/fix-typos
3dd8490
Place bellman multicore operations behind a (default) feature flag
955e679
Merge pull request #46 from str4d/ff-traits
d4ddaa9
Fix typos
12f93f2
Add ff and group crates to Cargo workspace
2e35a32
Update sapling-crypto crate to use ff crate
2019e63
Update workspace after pulling in external crates
git-subtree-dir: bellman
git-subtree-split: 2279da422c
2020-03-03 17:46:04 -07:00
Sean Bowe
805aa45f9e
Merge commit '05a9f3360f7fbd298f3e6f8f7e55e9426d04f2f0' into depends-updates-2
2020-03-03 17:45:49 -07:00
Sean Bowe
05a9f3360f
Squashed 'pairing/' changes from 3d41ee5..3870f11
...
3870f11
Bump version and ff dependency
e8657fa
Merge pull request #108 from kigawas/fix-rngcore-sized
7fddfc7
Update Cargo.toml
df0217c
bump group version
cbc1917
bump version
98133d9
fix RngCore Sized
583c744
pairing 0.15.0
0de7279
Fix pairing benchmarks
dd2fbb3
Crate docs
97c45f2
Update READMEs
9aef129
CI: Check intra-doc links
f552b49
Add READMEs to Cargo.toml files
8c59b4a
cargo fmt
33993f4
cargo fix --edition-idioms for pairing
36788f3
Add edition = 2018
df88a3f
cargo fmt
d9a1288
cargo fix --edition for pairing
013fd03
cargo fmt pairing
5635612
Fix clippy linter errors in pairing crate
ba40e2f
Use modern clippy linter syntax
fa4eaeb
Migrate to rand 0.7
1d00588
Migrate ff, group, pairing, and bellman to rand 0.6
95a749b
Migrate pairing to rand 0.5
01e7212
Add ff and group crates to Cargo workspace
git-subtree-dir: pairing
git-subtree-split: 3870f1172f
2020-03-03 17:44:53 -07:00
Sean Bowe
31d887c943
Merge commit 'd7f78db121ee6f720e97401ded0c9c597d1a4857' into depends-updates-2
2020-03-03 17:44:28 -07:00
Sean Bowe
d7f78db121
Squashed 'ff/' changes from 661558e..ddff465
...
ddff465
Bump version and dependency on ff_derive
25d11d6
Bump version
95e2723
Bump version to 0.5.1
f76872a
Add ?Sized to RngCore trait bounds (#14 )
09a32b1
ff 0.5.0
32543ab
Crate docs
22031dc
Update READMEs
658fe6d
CI: Check intra-doc links
35f5026
Add READMEs to Cargo.toml files
6804225
Migrate ff_derive to proc-macro2 1.0
b9a79ce
cargo fmt
82574c2
cargo fix --edition-idioms for ff
3b0cf72
Add edition = 2018
8a2b51b
Replace try! macro
40fc9ba
cargo fix --edition for ff
22c67f3
cargo fmt
312141c
Clarify masking of bits in Field::random impls
89a68e1
Migrate to rand 0.7
58415fb
Migrate ff, group, pairing, and bellman to rand 0.6
8b6e6b1
Migrate ff to rand_core 0.3 (used by rand 0.5)
git-subtree-dir: ff
git-subtree-split: ddff4658dd
2020-03-03 17:43:16 -07:00
str4d
d4bae99cb7
Merge pull request #204 from str4d/proving-api-ux-refactors
...
UX refactors for proving-related APIs
2020-02-16 18:56:46 +00:00
Jack Grigg
2d30c29d06
Pass &impl TxProver to Builder::build
...
This allows the caller to build multiple transactions with a single
proving backend.
2020-02-08 00:37:31 +00:00