Skip to content

Commit

Permalink
Squashed 'jubjub/' changes from ec85333e..38d38af3
Browse files Browse the repository at this point in the history
38d38af3 Merge pull request zcash#32 from kevaundray/patch-1
af5598da Merge pull request zcash#33 from ZcashFoundation/scalar
109ec40d Add public Scalar type alias for Fr
8e9c5fe6 typo in Fr.rs
8e9337ee Merge pull request zcash#30 from rex4539/typos
5f4374c8 Fix typo

git-subtree-dir: jubjub
git-subtree-split: 38d38af3b792d2c55d815d214a7cd157dc8f71ad
  • Loading branch information
str4d committed Aug 22, 2020
1 parent d029dde commit 56da51f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fr.rs
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Expand Up @@ -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,
Expand Down

0 comments on commit 56da51f

Please sign in to comment.