Commit Graph

151 Commits

Author SHA1 Message Date
str4d 38d38af3b7
Merge pull request #32 from kevaundray/patch-1
Typo
2020-04-24 15:14:47 +12:00
str4d af5598dac6
Merge pull request #33 from ZcashFoundation/scalar
Add public Scalar type alias for Fr
2020-04-24 15:14:07 +12:00
Deirdre Connolly 109ec40d2a Add public Scalar type alias for Fr 2020-03-29 03:06:46 -04:00
decentralisedkev 8e9c5fe6aa
typo in Fr.rs 2020-03-07 20:34:59 +00:00
ebfull 8e9337ee1b
Merge pull request #30 from rex4539/typos
Fix typo
2019-12-09 10:56:00 -07:00
Dimitris Apostolou 5f4374c836
Fix typo 2019-12-07 15:51:54 +02:00
ebfull ec85333e44
Merge pull request #29 from zkcrypto/final-touches
Release of 0.3
2019-12-03 19:41:50 -07:00
Sean Bowe 607958b8a2
Bump version to 0.3 2019-12-03 18:32:47 -07:00
Sean Bowe 2e98dabcb8
Remove the std feature. 2019-12-03 18:31:04 -07:00
Sean Bowe b54b846b50
Make Fq/Fr similar to each other. 2019-12-03 18:17:35 -07:00
Sean Bowe e3766101f4
Bring in the macros used for operator overloading in the bls12_381 crate. 2019-12-03 18:01:28 -07:00
ebfull e83f7d2bd1
Merge pull request #26 from zkcrypto/bls12-381-scalar
Replace Fq implementation with bls12_381::Scalar
2019-12-01 17:40:38 -07:00
str4d cd510aa696
Merge pull request #27 from ZcashFoundation/remove-nightly-note
Remove nightly note
2019-11-27 22:54:22 +00:00
Henry de Valence b12ceb5623 Nit: change wording on use of the subtle crate.
It's not that the crate is relying on `subtle` to perform constant-time
arithmetic, because the arithmetic implementations are done in this crate and
it's the fact that they're implemented in a constant-time way that's important.
Using subtle helps with constant-time operations but it is not enough, and
changing the wording of that sentence clarifies that.

(This is a nit).
2019-11-27 11:03:44 -08:00
Henry de Valence 62937011f7 Remove nightly advice for subtle.
This is not necessary since 2.2.1.
2019-11-27 11:01:05 -08:00
Jack Grigg 00f028d5b3
Bump rand_core dev dependency to 0.5 2019-11-26 19:44:03 +00:00
Jack Grigg 71ab0bb707
Drop byteorder dependency 2019-11-26 19:41:50 +00:00
Jack Grigg 5a3dea32c5
Allow clippy::suspicious_arithmetic_impl on core::ops impls 2019-11-26 19:37:35 +00:00
Jack Grigg 4c1da9d8bc
Replace Fq implementation with bls12_381::Scalar 2019-11-26 19:26:41 +00:00
str4d e2e0f5089f
Merge pull request #25 from zkcrypto/ci-checks
CI checks
2019-11-26 18:43:20 +00:00
Jack Grigg d8f35139c5
Check no-std compatibility 2019-11-14 13:31:25 +00:00
Jack Grigg ab8293935a
Catch documentation errors caused by code changes 2019-11-14 13:30:07 +00:00
Jack Grigg 92b3e6a9b6
Actions CI workflow 2019-11-14 13:29:45 +00:00
Sean Bowe 5ad7728a1c
Bump version to 0.2.0 2019-06-03 12:23:33 -06:00
str4d 156366ea42
Merge pull request #24 from zkcrypto/more-api-edits
More api edits
2019-06-01 09:50:38 +01:00
Sean Bowe 160cb42398
Change various into_bytes to to_bytes. 2019-05-31 19:47:56 -06:00
Sean Bowe 02b05eb075
Make CompletedPoint::into_extended take ownership, and inline. 2019-05-31 19:41:15 -06:00
ebfull 803b6a3e65
Merge pull request #21 from str4d/stack-tweaks
Stack tweaks
2019-05-30 17:42:07 -06:00
Jack Grigg e1193d2ae9
impl Mul<Fr> for [Extended|Affine]NielsPoint 2019-05-29 17:30:24 +01:00
str4d 03b155901e
Merge pull request #23 from zkcrypto/constifying
Constifying
2019-05-29 17:05:25 +01:00
Sean Bowe 8c5adc3708
cargo fmt 2019-05-28 09:59:42 -06:00
Sean Bowe 4aebd80105
Change AffinePoint::to_niels to be a const fn. 2019-05-28 09:59:39 -06:00
Jack Grigg a6afd81603
AffineNielsPoint::multiply_bits
For parity with ExtendedNielsPoint::multiply_bits, and it is also
slightly more efficient to use if the caller is starting from an
AffinePoint.
2019-05-22 21:17:09 +01:00
Jack Grigg 798bc797e5
Update authors 2019-05-22 11:41:33 +01:00
Jack Grigg aa0628ffcf
ExtendedNielsPoint::multiply_bits
This allows the caller to control which stack frames pay the cost of
Montgomery reduction and scalar multiplication, by splitting
Fr::into_bytes out from the multiplication step. It also enables the
caller to drop the Montgomery multiplication and reduction round-trip if
they already have an encoded Fr element.
2019-05-22 11:41:33 +01:00
Jack Grigg c392ffbeb2
Use ExtendedNielsPoint::identity directly in ExtendedPoint::multiply
Saves two Fq multiplications and a stack allocation.
2019-05-22 11:41:33 +01:00
Jack Grigg c5bf022613
Remove unnecessary shadowing from Fq::invert and Fr::invert
Shadowing causes Rust to create new stack variables instead of reusing
the stack space. This change saves 160 bytes of stack space in
Fq::invert (a 20% saving in my tests), and 128 bytes of stack space in
Fr::invert.
2019-05-22 11:41:33 +01:00
Jack Grigg 085e8ae675
Replace unnecessary moves of Copy types with immutable references
This significantly reduces the size of the stack.
2019-05-22 11:39:16 +01:00
ebfull 8f6d6298d0
Merge pull request #22 from str4d/subtle-ctoption
Use CtOption from subtle crate
2019-05-20 15:51:23 -06:00
Jack Grigg cb57a647b5
Use CtOption from subtle crate
Closes #20.
2019-05-04 20:58:19 +01:00
Sean Bowe d2e5f79b14
0.1.0 release. 2019-03-31 23:29:56 -06:00
Sean Bowe 9645f9dc82
Fix benchmarks 2019-03-31 23:17:24 -06:00
Sean Bowe e72b382055
Fix comment regarding montgomery reduction 2019-03-31 23:15:27 -06:00
Sean Bowe 35d32faa63
Add implementations of is_prime_order() for AffinePoint and ExtendedPoint. 2019-03-26 21:31:34 -06:00
Sean Bowe 390aa23db2
Rename Maybe to CtOption, and do not expose submodule. 2019-03-26 21:13:50 -06:00
Sean Bowe 26de2362db
Add affine mixed addition operator overloading. 2019-03-26 20:59:28 -06:00
Sean Bowe 1d2a424c1e
Re-enable dead_code lints for EDWARDS_D/EDWARDS_D2. 2019-03-26 20:57:17 -06:00
Sean Bowe 3c630463df
Add tests for AffinePoint serialization and deserialization. 2019-03-26 20:56:56 -06:00
Sean Bowe 2601c13a2d
Remove glob import that was importing MODULUS from Fr. 2019-03-21 15:57:22 -06:00
Sean Bowe 8edc7ebe2f
Disallow unsafe code. 2019-03-21 15:52:13 -06:00