[][src]Module fiat_crypto::p521_64

Autogenerated: src/ExtractionOCaml/unsaturated_solinas --lang=Rust p521 9 '2^521 - 1' 64 carry_mul carry_square carry add sub opp selectznz to_bytes from_bytes curve description: p521 requested operations: carry_mul, carry_square, carry, add, sub, opp, selectznz, to_bytes, from_bytes n = 9 (from "9") s-c = 2^521 - [(1, 1)] (from "2^521 - 1") machine_wordsize = 64 (from "64")

Computed values: carry_chain = [0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1] eval z = z[0] + (z[1] << 58) + (z[2] << 116) + (z[3] << 174) + (z[4] << 232) + (z[5] << 0x122) + (z[6] << 0x15c) + (z[7] << 0x196) + (z[8] << 0x1d0) bytes_eval z = z[0] + (z[1] << 8) + (z[2] << 16) + (z[3] << 24) + (z[4] << 32) + (z[5] << 40) + (z[6] << 48) + (z[7] << 56) + (z[8] << 64) + (z[9] << 72) + (z[10] << 80) + (z[11] << 88) + (z[12] << 96) + (z[13] << 104) + (z[14] << 112) + (z[15] << 120) + (z[16] << 128) + (z[17] << 136) + (z[18] << 144) + (z[19] << 152) + (z[20] << 160) + (z[21] << 168) + (z[22] << 176) + (z[23] << 184) + (z[24] << 192) + (z[25] << 200) + (z[26] << 208) + (z[27] << 216) + (z[28] << 224) + (z[29] << 232) + (z[30] << 240) + (z[31] << 248) + (z[32] << 256) + (z[33] << 0x108) + (z[34] << 0x110) + (z[35] << 0x118) + (z[36] << 0x120) + (z[37] << 0x128) + (z[38] << 0x130) + (z[39] << 0x138) + (z[40] << 0x140) + (z[41] << 0x148) + (z[42] << 0x150) + (z[43] << 0x158) + (z[44] << 0x160) + (z[45] << 0x168) + (z[46] << 0x170) + (z[47] << 0x178) + (z[48] << 0x180) + (z[49] << 0x188) + (z[50] << 0x190) + (z[51] << 0x198) + (z[52] << 0x1a0) + (z[53] << 0x1a8) + (z[54] << 0x1b0) + (z[55] << 0x1b8) + (z[56] << 0x1c0) + (z[57] << 0x1c8) + (z[58] << 0x1d0) + (z[59] << 0x1d8) + (z[60] << 0x1e0) + (z[61] << 0x1e8) + (z[62] << 0x1f0) + (z[63] << 0x1f8) + (z[64] << 2^9) + (z[65] << 0x208)

Functions

fiat_p521_carry_mul

The function fiat_p521_carry_mul multiplies two field elements and reduces the result. Postconditions: eval out1 mod m = (eval arg1 * eval arg2) mod m

fiat_p521_carry_square

The function fiat_p521_carry_square squares a field element and reduces the result. Postconditions: eval out1 mod m = (eval arg1 * eval arg1) mod m

fiat_p521_carry

The function fiat_p521_carry reduces a field element. Postconditions: eval out1 mod m = eval arg1 mod m

fiat_p521_add

The function fiat_p521_add adds two field elements. Postconditions: eval out1 mod m = (eval arg1 + eval arg2) mod m

fiat_p521_sub

The function fiat_p521_sub subtracts two field elements. Postconditions: eval out1 mod m = (eval arg1 - eval arg2) mod m

fiat_p521_opp

The function fiat_p521_opp negates a field element. Postconditions: eval out1 mod m = -eval arg1 mod m

fiat_p521_selectznz

The function fiat_p521_selectznz is a multi-limb conditional select. Postconditions: eval out1 = (if arg1 = 0 then eval arg2 else eval arg3)

fiat_p521_to_bytes

The function fiat_p521_to_bytes serializes a field element to bytes in little-endian order. Postconditions: out1 = map (λ x, ⌊((eval arg1 mod m) mod 2^(8 * (x + 1))) / 2^(8 * x)⌋) [0..65]

fiat_p521_from_bytes

The function fiat_p521_from_bytes deserializes a field element from bytes in little-endian order. Postconditions: eval out1 mod m = bytes_eval arg1 mod m

fiat_p521_addcarryx_u57

The function fiat_p521_addcarryx_u57 is an addition with carry. Postconditions: out1 = (arg1 + arg2 + arg3) mod 2^57 out2 = ⌊(arg1 + arg2 + arg3) / 2^57⌋

fiat_p521_addcarryx_u58

The function fiat_p521_addcarryx_u58 is an addition with carry. Postconditions: out1 = (arg1 + arg2 + arg3) mod 2^58 out2 = ⌊(arg1 + arg2 + arg3) / 2^58⌋

fiat_p521_cmovznz_u64

The function fiat_p521_cmovznz_u64 is a single-word conditional move. Postconditions: out1 = (if arg1 = 0 then arg2 else arg3)

fiat_p521_subborrowx_u57

The function fiat_p521_subborrowx_u57 is a subtraction with borrow. Postconditions: out1 = (-arg1 + arg2 + -arg3) mod 2^57 out2 = -⌊(-arg1 + arg2 + -arg3) / 2^57⌋

fiat_p521_subborrowx_u58

The function fiat_p521_subborrowx_u58 is a subtraction with borrow. Postconditions: out1 = (-arg1 + arg2 + -arg3) mod 2^58 out2 = -⌊(-arg1 + arg2 + -arg3) / 2^58⌋

Type Definitions

fiat_p521_i1
fiat_p521_i2
fiat_p521_u1
fiat_p521_u2