github.com/cloudflare/circl@v1.5.0/ecc/bls12381/ff/doc.go (about)

     1  // Package ff provides finite fields and groups useful for the BLS12-381 curve.
     2  //
     3  // # Fp
     4  //
     5  // Fp are elements of the prime field GF(p), where
     6  //
     7  //	p = 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab
     8  //
     9  // The binary representation takes FpSize = 48 bytes encoded in big-endian form.
    10  //
    11  // # Fp2
    12  //
    13  // Fp2 are elements of the finite field GF(p^2) = Fp[u]/(u^2+1) represented as
    14  //
    15  //	(a[1]u + a[0]) in Fp2, where a[0],a[1] in Fp
    16  //
    17  // The binary representation takes Fp2Size = 96 bytes encoded as a[1] || a[0]
    18  // all in big-endian form.
    19  //
    20  // # Fp4
    21  //
    22  // Fp4 is GF(p^4)=Fp2[t]/(t^2-(u+1)). We use the representation  a[1]v+a[0].
    23  // There is no fixed external form.
    24  //
    25  // # Fp6
    26  //
    27  // Fp6 are elements of the finite field GF(p^6) = Fp2[v]/(v^3-u-1) represented as
    28  //
    29  //	(a[2]v^2 + a[1]v + a[0]) in Fp6, where a[0],a[1],a[2] in Fp2
    30  //
    31  // The binary representation takes Fp6Size = 288 bytes encoded as a[2] || a[1] || a[0]
    32  // all in big-endian form.
    33  //
    34  // # Fp12
    35  //
    36  // Fp12 are elements of the finite field GF(p^12) = Fp6[w]/(w^2-v) represented as
    37  //
    38  //	(a[1]w + a[0]) in Fp12, where a[0],a[1] in Fp6
    39  //
    40  // The binary representation takes Fp12Size = 576 bytes encoded as a[1] || a[0]
    41  // all in big-endian form.
    42  //
    43  // We can also represent this field via Fp4[w]/(w^3-t). This is the struct Fp12alt,
    44  // used to accelerate the pairing calculation.
    45  //
    46  // # Scalar
    47  //
    48  // Scalar are elements of the prime field GF(r), where
    49  //
    50  //	r = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001
    51  //
    52  // The binary representation takes ScalarSize = 32 bytes encoded in big-endian form.
    53  //
    54  // # Groups
    55  //
    56  // Cyclo6 are elements of the 6th cyclotomic group contained in Fp12.
    57  // For efficient arithmetic see Granger-Scott "Faster Squaring in the Cyclotomic Subgroup of Sixth
    58  // Degree Extensions" (https://eprint.iacr.org/2009/565).
    59  //
    60  // URoot are elements of the r-roots of unity group contained in Fp12.
    61  package ff