Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

fromBytes

The function fromBytes deserializes a field element NOT in the Montgomery domain from bytes in little-endian order.

Preconditions: 0 ≤ bytes_eval arg1 < m Postconditions: eval out1 mod m = bytes_eval arg1 mod m 0 ≤ eval out1 < m

Input Bounds: arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] Output Bounds: out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]

p384_64.fromBytes
pub fn fromBytes(out1: *[6]u64, arg1: [48]u8) void

File

Code

pub fn fromBytes(out1: *[6]u64, arg1: [48]u8) void {
    @setRuntimeSafety(mode == .debug);

    const x1 = (@as(u64, (arg1[47])) << 56);
    const x2 = (@as(u64, (arg1[46])) << 48);
    const x3 = (@as(u64, (arg1[45])) << 40);
    const x4 = (@as(u64, (arg1[44])) << 32);
    const x5 = (@as(u64, (arg1[43])) << 24);
    const x6 = (@as(u64, (arg1[42])) << 16);
    const x7 = (@as(u64, (arg1[41])) << 8);
    const x8 = (arg1[40]);
    const x9 = (@as(u64, (arg1[39])) << 56);
    const x10 = (@as(u64, (arg1[38])) << 48);
    const x11 = (@as(u64, (arg1[37])) << 40);
    const x12 = (@as(u64, (arg1[36])) << 32);
    const x13 = (@as(u64, (arg1[35])) << 24);
    const x14 = (@as(u64, (arg1[34])) << 16);
    const x15 = (@as(u64, (arg1[33])) << 8);
    const x16 = (arg1[32]);
    const x17 = (@as(u64, (arg1[31])) << 56);
    const x18 = (@as(u64, (arg1[30])) << 48);
    const x19 = (@as(u64, (arg1[29])) << 40);
    const x20 = (@as(u64, (arg1[28])) << 32);
    const x21 = (@as(u64, (arg1[27])) << 24);
    const x22 = (@as(u64, (arg1[26])) << 16);
    const x23 = (@as(u64, (arg1[25])) << 8);
    const x24 = (arg1[24]);
    const x25 = (@as(u64, (arg1[23])) << 56);
    const x26 = (@as(u64, (arg1[22])) << 48);
    const x27 = (@as(u64, (arg1[21])) << 40);
    const x28 = (@as(u64, (arg1[20])) << 32);
    const x29 = (@as(u64, (arg1[19])) << 24);
    const x30 = (@as(u64, (arg1[18])) << 16);
    const x31 = (@as(u64, (arg1[17])) << 8);
    const x32 = (arg1[16]);
    const x33 = (@as(u64, (arg1[15])) << 56);
    const x34 = (@as(u64, (arg1[14])) << 48);
    const x35 = (@as(u64, (arg1[13])) << 40);
    const x36 = (@as(u64, (arg1[12])) << 32);
    const x37 = (@as(u64, (arg1[11])) << 24);
    const x38 = (@as(u64, (arg1[10])) << 16);
    const x39 = (@as(u64, (arg1[9])) << 8);
    const x40 = (arg1[8]);
    const x41 = (@as(u64, (arg1[7])) << 56);
    const x42 = (@as(u64, (arg1[6])) << 48);
    const x43 = (@as(u64, (arg1[5])) << 40);
    const x44 = (@as(u64, (arg1[4])) << 32);
    const x45 = (@as(u64, (arg1[3])) << 24);
    const x46 = (@as(u64, (arg1[2])) << 16);
    const x47 = (@as(u64, (arg1[1])) << 8);
    const x48 = (arg1[0]);
    const x49 = (x47 + @as(u64, x48));
    const x50 = (x46 + x49);
    const x51 = (x45 + x50);
    const x52 = (x44 + x51);
    const x53 = (x43 + x52);
    const x54 = (x42 + x53);
    const x55 = (x41 + x54);
    const x56 = (x39 + @as(u64, x40));
    const x57 = (x38 + x56);
    const x58 = (x37 + x57);
    const x59 = (x36 + x58);
    const x60 = (x35 + x59);
    const x61 = (x34 + x60);
    const x62 = (x33 + x61);
    const x63 = (x31 + @as(u64, x32));
    const x64 = (x30 + x63);
    const x65 = (x29 + x64);
    const x66 = (x28 + x65);
    const x67 = (x27 + x66);
    const x68 = (x26 + x67);
    const x69 = (x25 + x68);
    const x70 = (x23 + @as(u64, x24));
    const x71 = (x22 + x70);
    const x72 = (x21 + x71);
    const x73 = (x20 + x72);
    const x74 = (x19 + x73);
    const x75 = (x18 + x74);
    const x76 = (x17 + x75);
    const x77 = (x15 + @as(u64, x16));
    const x78 = (x14 + x77);
    const x79 = (x13 + x78);
    const x80 = (x12 + x79);
    const x81 = (x11 + x80);
    const x82 = (x10 + x81);
    const x83 = (x9 + x82);
    const x84 = (x7 + @as(u64, x8));
    const x85 = (x6 + x84);
    const x86 = (x5 + x85);
    const x87 = (x4 + x86);
    const x88 = (x3 + x87);
    const x89 = (x2 + x88);
    const x90 = (x1 + x89);
    out1[0] = x55;
    out1[1] = x62;
    out1[2] = x69;
    out1[3] = x76;
    out1[4] = x83;
    out1[5] = x90;
}