| ... | @@ -93,7 +93,7 @@ pub const Fe = struct { | ... | @@ -93,7 +93,7 @@ pub const Fe = struct { |
| 93 | return s; | 93 | return s; |
| 94 | } | 94 | } |
| 95 | | 95 | |
| 96 | /// Map a 64-bit big endian string into a field element | 96 | /// Map a 64 bytes big endian string into a field element |
| 97 | pub fn fromBytes64(s: [64]u8) Fe { | 97 | pub fn fromBytes64(s: [64]u8) Fe { |
| 98 | var fl: [32]u8 = undefined; | 98 | var fl: [32]u8 = undefined; |
| 99 | var gl: [32]u8 = undefined; | 99 | var gl: [32]u8 = undefined; |
| ... | @@ -106,7 +106,7 @@ pub const Fe = struct { | ... | @@ -106,7 +106,7 @@ pub const Fe = struct { |
| 106 | gl[31] &= 0x7f; | 106 | gl[31] &= 0x7f; |
| 107 | var fe_f = fromBytes(fl); | 107 | var fe_f = fromBytes(fl); |
| 108 | const fe_g = fromBytes(gl); | 108 | const fe_g = fromBytes(gl); |
| 109 | fe_f.limbs[0] += (s[32] >> 7) * 19; | 109 | fe_f.limbs[0] += (s[32] >> 7) * 19 + @as(u10, s[0] >> 7) * 722; |
| 110 | i = 0; | 110 | i = 0; |
| 111 | while (i < 5) : (i += 1) { | 111 | while (i < 5) : (i += 1) { |
| 112 | fe_f.limbs[i] += 38 * fe_g.limbs[i]; | 112 | fe_f.limbs[i] += 38 * fe_g.limbs[i]; |