From 56da51f3ce79fa4e6144af5f986d3bb9e0838590 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 22 Aug 2020 02:03:05 +0100 Subject: [PATCH] Squashed 'jubjub/' changes from ec85333e..38d38af3 38d38af3 Merge pull request #32 from kevaundray/patch-1 af5598da Merge pull request #33 from ZcashFoundation/scalar 109ec40d Add public Scalar type alias for Fr 8e9c5fe6 typo in Fr.rs 8e9337ee Merge pull request #30 from rex4539/typos 5f4374c8 Fix typo git-subtree-dir: jubjub git-subtree-split: 38d38af3b792d2c55d815d214a7cd157dc8f71ad --- src/fr.rs | 4 ++-- src/lib.rs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/fr.rs b/src/fr.rs index 4495e3bd7..b8412c779 100644 --- a/src/fr.rs +++ b/src/fr.rs @@ -139,7 +139,7 @@ const R2: Fr = Fr([ 0x04f6547b8d127688, ]); -/// R^2 = 2^768 mod r +/// R^3 = 2^768 mod r const R3: Fr = Fr([ 0xe0d6c6563d830544, 0x323e3883598d0f85, @@ -241,7 +241,7 @@ impl Fr { // // and computing their sum in the field. It remains to see that arbitrary 256-bit // numbers can be placed into Montgomery form safely using the reduction. The - // reduction works so long as the product is less than R=2^256 multipled by + // reduction works so long as the product is less than R=2^256 multiplied by // the modulus. This holds because for any `c` smaller than the modulus, we have // that (2^256 - 1)*c is an acceptable product for the reduction. Therefore, the // reduction always works so long as `c` is in the field; in this case it is either the diff --git a/src/lib.rs b/src/lib.rs index 841948796..3de1a2d96 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,6 +42,9 @@ mod fr; pub use bls12_381::Scalar as Fq; pub use fr::Fr; +/// A better name than Fr. +pub type Scalar = Fr; + const FR_MODULUS_BYTES: [u8; 32] = [ 183, 44, 247, 214, 94, 14, 151, 208, 130, 16, 200, 204, 147, 32, 104, 166, 0, 59, 52, 1, 1, 59, 103, 6, 169, 175, 51, 101, 234, 180, 125, 14,