Merge commit '56da51f3ce79fa4e6144af5f986d3bb9e0838590' into jubjub-subtree-update
This commit is contained in:
commit
33b0758f4f
|
@ -174,7 +174,7 @@ const R2: Fr = Fr([
|
||||||
0x04f6_547b_8d12_7688,
|
0x04f6_547b_8d12_7688,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/// R^2 = 2^768 mod r
|
/// R^3 = 2^768 mod r
|
||||||
const R3: Fr = Fr([
|
const R3: Fr = Fr([
|
||||||
0xe0d6_c656_3d83_0544,
|
0xe0d6_c656_3d83_0544,
|
||||||
0x323e_3883_598d_0f85,
|
0x323e_3883_598d_0f85,
|
||||||
|
@ -276,7 +276,7 @@ impl Fr {
|
||||||
//
|
//
|
||||||
// and computing their sum in the field. It remains to see that arbitrary 256-bit
|
// 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
|
// 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
|
// 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
|
// 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
|
// reduction always works so long as `c` is in the field; in this case it is either the
|
||||||
|
|
|
@ -52,6 +52,9 @@ mod fr;
|
||||||
pub use bls12_381::Scalar as Fq;
|
pub use bls12_381::Scalar as Fq;
|
||||||
pub use fr::Fr;
|
pub use fr::Fr;
|
||||||
|
|
||||||
|
/// A better name than Fr.
|
||||||
|
pub type Scalar = Fr;
|
||||||
|
|
||||||
const FR_MODULUS_BYTES: [u8; 32] = [
|
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,
|
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,
|
103, 6, 169, 175, 51, 101, 234, 180, 125, 14,
|
||||||
|
|
Loading…
Reference in New Issue