Function kimchi_msm::serialization::interpreter::deserialize_field_element
source · pub fn deserialize_field_element<F: PrimeField, Ff: PrimeField, Env: ColAccessCap<F, SerializationColumn> + LookupCap<F, SerializationColumn, LookupTable<Ff>> + HybridCopyCap<F, SerializationColumn> + HybridSerHelpers<F, SerializationColumn, LookupTable<Ff>>>(
env: &mut Env,
limbs: [BigUint; 3]
)
Expand description
Deserialize a field element of the scalar field of Vesta or Pallas given as a sequence of 3 limbs of 88 bits. It will deserialize into limbs of 15 bits. Given a scalar field element of Vesta or Pallas, here the decomposition:
limbs = [limbs0, limbs1, limbs2]
| limbs0 | limbs1 | limbs2 |
| 0 ... 87 | 88 ... 175 | 176 .. 264 |
---- ---- ----
/ \ / \ / \
(1) (2) (3)
(1): c0 = 0...14, c1 = 15..29, c2 = 30..44, c3 = 45..59, c4 = 60..74
(1) and (2): c5 = limbs0[75]..limbs0[87] || limbs1[0]..limbs1[1]
(2): c6 = 2...16, c7 = 17..31, c8 = 32..46, c9 = 47..61, c10 = 62..76
(2) and (3): c11 = limbs1[77]..limbs1[87] || limbs2[0]..limbs2[3]
(3) c12 = 4...18, c13 = 19..33, c14 = 34..48, c15 = 49..63, c16 = 64..78
And we can ignore the last 10 bits (i.e. limbs2[78..87]
) as a field element
is 254bits long.