@amritk/nish-aarch64-darwin 0.34.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1021,12 +1021,14 @@ const bcryptLoadSlot = (state: Secret<u32[]>, password: Secret<u8[]>, slot: i32)
1021
1021
  }
1022
1022
 
1023
1023
  // The cost-round kernels, one per width. Each is `bcryptBody4`'s text with
1024
- // the lane count changed (bench/crypto/bcrypt/gen-body.mjs writes them), not
1024
+ // the lane count changed, except that six lanes' sixth lane takes its bytes
1025
+ // the previous way (see `bcryptBody4`); bench/crypto/bcrypt/gen-body.mjs
1026
+ // writes them all, so an edit is made there. They are not
1025
1027
  // one loop over a lane count: the lanes' l and r must live in registers and
1026
1028
  // their loads be scheduled together, which a loop over an array of lanes
1027
1029
  // does not give. Two lanes take each byte by its own shift and write every
1028
1030
  // lane's bytes before any lane's update, the form all widths had before the
1029
- // rotated copy, which measured slower there.
1031
+ // copies behind the barrier, which measured slower there.
1030
1032
 
1031
1033
  /** `bcryptBody4`'s interleave on two lanes. */
1032
1034
  const bcryptBody2 = (st: u32[]): void => {
@@ -1091,41 +1093,47 @@ const bcryptBody3 = (st: u32[]): void => {
1091
1093
  l1 ^= st[1042]
1092
1094
  l2 ^= st[2084]
1093
1095
  for (let n: i32 = 1; n < 17; n += 2) {
1094
- const l0e: u32 = ctSelect((l0 >>> 8) | (l0 << 24), 0xffffffff, 0)
1095
- const l0a: i32 = toI32(l0 >>> 24) & 0xff
1096
- const l0b: i32 = toI32(l0e >>> 8) & 0xff
1097
- const l0c: i32 = toI32(l0e) & 0xff
1098
- const l0d: i32 = toI32(l0) & 0xff
1096
+ const l0e: u32 = ctSelect(l0, 0xffffffff, 0)
1097
+ const l0d: i32 = toI32(l0e) & 0xff
1098
+ const l0c: i32 = toI32(l0e >>> 8) & 0xff
1099
+ const l0f: u32 = ctSelect(l0e >>> 16, 0xffffffff, 0)
1100
+ const l0b: i32 = toI32(l0f) & 0xff
1101
+ const l0a: i32 = toI32(l0f >>> 8) & 0xff
1099
1102
  r0 ^= st[n] ^ (((st[18 + l0a] + st[274 + l0b]) ^ st[530 + l0c]) + st[786 + l0d])
1100
- const l1e: u32 = ctSelect((l1 >>> 8) | (l1 << 24), 0xffffffff, 0)
1101
- const l1a: i32 = toI32(l1 >>> 24) & 0xff
1102
- const l1b: i32 = toI32(l1e >>> 8) & 0xff
1103
- const l1c: i32 = toI32(l1e) & 0xff
1104
- const l1d: i32 = toI32(l1) & 0xff
1103
+ const l1e: u32 = ctSelect(l1, 0xffffffff, 0)
1104
+ const l1d: i32 = toI32(l1e) & 0xff
1105
+ const l1c: i32 = toI32(l1e >>> 8) & 0xff
1106
+ const l1f: u32 = ctSelect(l1e >>> 16, 0xffffffff, 0)
1107
+ const l1b: i32 = toI32(l1f) & 0xff
1108
+ const l1a: i32 = toI32(l1f >>> 8) & 0xff
1105
1109
  r1 ^= st[1042 + n] ^ (((st[1060 + l1a] + st[1316 + l1b]) ^ st[1572 + l1c]) + st[1828 + l1d])
1106
- const l2e: u32 = ctSelect((l2 >>> 8) | (l2 << 24), 0xffffffff, 0)
1107
- const l2a: i32 = toI32(l2 >>> 24) & 0xff
1108
- const l2b: i32 = toI32(l2e >>> 8) & 0xff
1109
- const l2c: i32 = toI32(l2e) & 0xff
1110
- const l2d: i32 = toI32(l2) & 0xff
1110
+ const l2e: u32 = ctSelect(l2, 0xffffffff, 0)
1111
+ const l2d: i32 = toI32(l2e) & 0xff
1112
+ const l2c: i32 = toI32(l2e >>> 8) & 0xff
1113
+ const l2f: u32 = ctSelect(l2e >>> 16, 0xffffffff, 0)
1114
+ const l2b: i32 = toI32(l2f) & 0xff
1115
+ const l2a: i32 = toI32(l2f >>> 8) & 0xff
1111
1116
  r2 ^= st[2084 + n] ^ (((st[2102 + l2a] + st[2358 + l2b]) ^ st[2614 + l2c]) + st[2870 + l2d])
1112
- const r0e: u32 = ctSelect((r0 >>> 8) | (r0 << 24), 0xffffffff, 0)
1113
- const r0a: i32 = toI32(r0 >>> 24) & 0xff
1114
- const r0b: i32 = toI32(r0e >>> 8) & 0xff
1115
- const r0c: i32 = toI32(r0e) & 0xff
1116
- const r0d: i32 = toI32(r0) & 0xff
1117
+ const r0e: u32 = ctSelect(r0, 0xffffffff, 0)
1118
+ const r0d: i32 = toI32(r0e) & 0xff
1119
+ const r0c: i32 = toI32(r0e >>> 8) & 0xff
1120
+ const r0f: u32 = ctSelect(r0e >>> 16, 0xffffffff, 0)
1121
+ const r0b: i32 = toI32(r0f) & 0xff
1122
+ const r0a: i32 = toI32(r0f >>> 8) & 0xff
1117
1123
  l0 ^= st[n + 1] ^ (((st[18 + r0a] + st[274 + r0b]) ^ st[530 + r0c]) + st[786 + r0d])
1118
- const r1e: u32 = ctSelect((r1 >>> 8) | (r1 << 24), 0xffffffff, 0)
1119
- const r1a: i32 = toI32(r1 >>> 24) & 0xff
1120
- const r1b: i32 = toI32(r1e >>> 8) & 0xff
1121
- const r1c: i32 = toI32(r1e) & 0xff
1122
- const r1d: i32 = toI32(r1) & 0xff
1124
+ const r1e: u32 = ctSelect(r1, 0xffffffff, 0)
1125
+ const r1d: i32 = toI32(r1e) & 0xff
1126
+ const r1c: i32 = toI32(r1e >>> 8) & 0xff
1127
+ const r1f: u32 = ctSelect(r1e >>> 16, 0xffffffff, 0)
1128
+ const r1b: i32 = toI32(r1f) & 0xff
1129
+ const r1a: i32 = toI32(r1f >>> 8) & 0xff
1123
1130
  l1 ^= st[1042 + n + 1] ^ (((st[1060 + r1a] + st[1316 + r1b]) ^ st[1572 + r1c]) + st[1828 + r1d])
1124
- const r2e: u32 = ctSelect((r2 >>> 8) | (r2 << 24), 0xffffffff, 0)
1125
- const r2a: i32 = toI32(r2 >>> 24) & 0xff
1126
- const r2b: i32 = toI32(r2e >>> 8) & 0xff
1127
- const r2c: i32 = toI32(r2e) & 0xff
1128
- const r2d: i32 = toI32(r2) & 0xff
1131
+ const r2e: u32 = ctSelect(r2, 0xffffffff, 0)
1132
+ const r2d: i32 = toI32(r2e) & 0xff
1133
+ const r2c: i32 = toI32(r2e >>> 8) & 0xff
1134
+ const r2f: u32 = ctSelect(r2e >>> 16, 0xffffffff, 0)
1135
+ const r2b: i32 = toI32(r2f) & 0xff
1136
+ const r2a: i32 = toI32(r2f >>> 8) & 0xff
1129
1137
  l2 ^= st[2084 + n + 1] ^ (((st[2102 + r2a] + st[2358 + r2b]) ^ st[2614 + r2c]) + st[2870 + r2d])
1130
1138
  }
1131
1139
  const t0: u32 = r0
@@ -1153,17 +1161,20 @@ const bcryptBody3 = (st: u32[]): void => {
1153
1161
  * hot loop of the batch: 2^(cost+1) calls of 521 blocks per lane.
1154
1162
  *
1155
1163
  * Each lane's half-round is written whole, its bytes and then its update,
1156
- * before the next lane's. The two middle index bytes come from one copy of the
1157
- * word rotated right by 8 (`e`: byte 1 is its low byte, byte 2 its second),
1158
- * behind the value barrier: `ctSelect(v, 0xffffffff, 0)` is `v`, opaque, so
1159
- * LLVM cannot fold the two bytes back into two shifts of the word, and copies
1160
- * it once instead of twice; on a BMI2 target the copy is one `rorx`. Three
1161
- * and five lanes rotate the copy the same way; six shift it right by 8, which
1162
- * has the same two low bytes and measured faster there. On a
1163
- * Xeon Platinum 8260 that is 6% less time a hash at the best width, 9% under
1164
- * `--cpu x86-64-v3` (docs/security/crypto-bcrypt.md, "Cascade Lake"). The
1165
- * barrier is an identity on a register: it adds no branch and no load, and
1166
- * the round reads the same four S-box words.
1164
+ * before the next lane's. The bytes come in two pairs, each the low and
1165
+ * second byte of a copy behind the value barrier: `ctSelect(v, 0xffffffff, 0)`
1166
+ * is `v`, opaque. A copy of the word (`e`) gives bytes 0 and 1, and that copy
1167
+ * moved down by 16 (`f`) bytes 2 and 3, so a second byte is one `movzx` from
1168
+ * `ah`, `bh`, `ch` or `dh` and a lane takes its four bytes in six
1169
+ * instructions; without the barriers LLVM folds the pairs back into shifts of
1170
+ * the word. Only four registers have a second byte, and with all six lanes
1171
+ * paired the loop spilled more than it saved (counted), so at six lanes the
1172
+ * sixth lane takes bytes 1 and 2 from one copy moved down by 8 and bytes 0
1173
+ * and 3 by shifts of the word, the way every lane had before. On a Xeon Platinum
1174
+ * 8260 the pairs take about 3.5% less time a hash than that way at the best
1175
+ * width, five lanes, and 5.6% less at six (docs/security/crypto-bcrypt.md,
1176
+ * "Cascade Lake"). The barrier is an identity on a register: it adds no
1177
+ * branch and no load, and the round reads the same four S-box words.
1167
1178
  */
1168
1179
  const bcryptBody4 = (st: u32[]): void => {
1169
1180
  if (st.length < 4168) {
@@ -1183,53 +1194,61 @@ const bcryptBody4 = (st: u32[]): void => {
1183
1194
  l2 ^= st[2084]
1184
1195
  l3 ^= st[3126]
1185
1196
  for (let n: i32 = 1; n < 17; n += 2) {
1186
- const l0e: u32 = ctSelect((l0 >>> 8) | (l0 << 24), 0xffffffff, 0)
1187
- const l0a: i32 = toI32(l0 >>> 24) & 0xff
1188
- const l0b: i32 = toI32(l0e >>> 8) & 0xff
1189
- const l0c: i32 = toI32(l0e) & 0xff
1190
- const l0d: i32 = toI32(l0) & 0xff
1197
+ const l0e: u32 = ctSelect(l0, 0xffffffff, 0)
1198
+ const l0d: i32 = toI32(l0e) & 0xff
1199
+ const l0c: i32 = toI32(l0e >>> 8) & 0xff
1200
+ const l0f: u32 = ctSelect(l0e >>> 16, 0xffffffff, 0)
1201
+ const l0b: i32 = toI32(l0f) & 0xff
1202
+ const l0a: i32 = toI32(l0f >>> 8) & 0xff
1191
1203
  r0 ^= st[n] ^ (((st[18 + l0a] + st[274 + l0b]) ^ st[530 + l0c]) + st[786 + l0d])
1192
- const l1e: u32 = ctSelect((l1 >>> 8) | (l1 << 24), 0xffffffff, 0)
1193
- const l1a: i32 = toI32(l1 >>> 24) & 0xff
1194
- const l1b: i32 = toI32(l1e >>> 8) & 0xff
1195
- const l1c: i32 = toI32(l1e) & 0xff
1196
- const l1d: i32 = toI32(l1) & 0xff
1204
+ const l1e: u32 = ctSelect(l1, 0xffffffff, 0)
1205
+ const l1d: i32 = toI32(l1e) & 0xff
1206
+ const l1c: i32 = toI32(l1e >>> 8) & 0xff
1207
+ const l1f: u32 = ctSelect(l1e >>> 16, 0xffffffff, 0)
1208
+ const l1b: i32 = toI32(l1f) & 0xff
1209
+ const l1a: i32 = toI32(l1f >>> 8) & 0xff
1197
1210
  r1 ^= st[1042 + n] ^ (((st[1060 + l1a] + st[1316 + l1b]) ^ st[1572 + l1c]) + st[1828 + l1d])
1198
- const l2e: u32 = ctSelect((l2 >>> 8) | (l2 << 24), 0xffffffff, 0)
1199
- const l2a: i32 = toI32(l2 >>> 24) & 0xff
1200
- const l2b: i32 = toI32(l2e >>> 8) & 0xff
1201
- const l2c: i32 = toI32(l2e) & 0xff
1202
- const l2d: i32 = toI32(l2) & 0xff
1211
+ const l2e: u32 = ctSelect(l2, 0xffffffff, 0)
1212
+ const l2d: i32 = toI32(l2e) & 0xff
1213
+ const l2c: i32 = toI32(l2e >>> 8) & 0xff
1214
+ const l2f: u32 = ctSelect(l2e >>> 16, 0xffffffff, 0)
1215
+ const l2b: i32 = toI32(l2f) & 0xff
1216
+ const l2a: i32 = toI32(l2f >>> 8) & 0xff
1203
1217
  r2 ^= st[2084 + n] ^ (((st[2102 + l2a] + st[2358 + l2b]) ^ st[2614 + l2c]) + st[2870 + l2d])
1204
- const l3e: u32 = ctSelect((l3 >>> 8) | (l3 << 24), 0xffffffff, 0)
1205
- const l3a: i32 = toI32(l3 >>> 24) & 0xff
1206
- const l3b: i32 = toI32(l3e >>> 8) & 0xff
1207
- const l3c: i32 = toI32(l3e) & 0xff
1208
- const l3d: i32 = toI32(l3) & 0xff
1218
+ const l3e: u32 = ctSelect(l3, 0xffffffff, 0)
1219
+ const l3d: i32 = toI32(l3e) & 0xff
1220
+ const l3c: i32 = toI32(l3e >>> 8) & 0xff
1221
+ const l3f: u32 = ctSelect(l3e >>> 16, 0xffffffff, 0)
1222
+ const l3b: i32 = toI32(l3f) & 0xff
1223
+ const l3a: i32 = toI32(l3f >>> 8) & 0xff
1209
1224
  r3 ^= st[3126 + n] ^ (((st[3144 + l3a] + st[3400 + l3b]) ^ st[3656 + l3c]) + st[3912 + l3d])
1210
- const r0e: u32 = ctSelect((r0 >>> 8) | (r0 << 24), 0xffffffff, 0)
1211
- const r0a: i32 = toI32(r0 >>> 24) & 0xff
1212
- const r0b: i32 = toI32(r0e >>> 8) & 0xff
1213
- const r0c: i32 = toI32(r0e) & 0xff
1214
- const r0d: i32 = toI32(r0) & 0xff
1225
+ const r0e: u32 = ctSelect(r0, 0xffffffff, 0)
1226
+ const r0d: i32 = toI32(r0e) & 0xff
1227
+ const r0c: i32 = toI32(r0e >>> 8) & 0xff
1228
+ const r0f: u32 = ctSelect(r0e >>> 16, 0xffffffff, 0)
1229
+ const r0b: i32 = toI32(r0f) & 0xff
1230
+ const r0a: i32 = toI32(r0f >>> 8) & 0xff
1215
1231
  l0 ^= st[n + 1] ^ (((st[18 + r0a] + st[274 + r0b]) ^ st[530 + r0c]) + st[786 + r0d])
1216
- const r1e: u32 = ctSelect((r1 >>> 8) | (r1 << 24), 0xffffffff, 0)
1217
- const r1a: i32 = toI32(r1 >>> 24) & 0xff
1218
- const r1b: i32 = toI32(r1e >>> 8) & 0xff
1219
- const r1c: i32 = toI32(r1e) & 0xff
1220
- const r1d: i32 = toI32(r1) & 0xff
1232
+ const r1e: u32 = ctSelect(r1, 0xffffffff, 0)
1233
+ const r1d: i32 = toI32(r1e) & 0xff
1234
+ const r1c: i32 = toI32(r1e >>> 8) & 0xff
1235
+ const r1f: u32 = ctSelect(r1e >>> 16, 0xffffffff, 0)
1236
+ const r1b: i32 = toI32(r1f) & 0xff
1237
+ const r1a: i32 = toI32(r1f >>> 8) & 0xff
1221
1238
  l1 ^= st[1042 + n + 1] ^ (((st[1060 + r1a] + st[1316 + r1b]) ^ st[1572 + r1c]) + st[1828 + r1d])
1222
- const r2e: u32 = ctSelect((r2 >>> 8) | (r2 << 24), 0xffffffff, 0)
1223
- const r2a: i32 = toI32(r2 >>> 24) & 0xff
1224
- const r2b: i32 = toI32(r2e >>> 8) & 0xff
1225
- const r2c: i32 = toI32(r2e) & 0xff
1226
- const r2d: i32 = toI32(r2) & 0xff
1239
+ const r2e: u32 = ctSelect(r2, 0xffffffff, 0)
1240
+ const r2d: i32 = toI32(r2e) & 0xff
1241
+ const r2c: i32 = toI32(r2e >>> 8) & 0xff
1242
+ const r2f: u32 = ctSelect(r2e >>> 16, 0xffffffff, 0)
1243
+ const r2b: i32 = toI32(r2f) & 0xff
1244
+ const r2a: i32 = toI32(r2f >>> 8) & 0xff
1227
1245
  l2 ^= st[2084 + n + 1] ^ (((st[2102 + r2a] + st[2358 + r2b]) ^ st[2614 + r2c]) + st[2870 + r2d])
1228
- const r3e: u32 = ctSelect((r3 >>> 8) | (r3 << 24), 0xffffffff, 0)
1229
- const r3a: i32 = toI32(r3 >>> 24) & 0xff
1230
- const r3b: i32 = toI32(r3e >>> 8) & 0xff
1231
- const r3c: i32 = toI32(r3e) & 0xff
1232
- const r3d: i32 = toI32(r3) & 0xff
1246
+ const r3e: u32 = ctSelect(r3, 0xffffffff, 0)
1247
+ const r3d: i32 = toI32(r3e) & 0xff
1248
+ const r3c: i32 = toI32(r3e >>> 8) & 0xff
1249
+ const r3f: u32 = ctSelect(r3e >>> 16, 0xffffffff, 0)
1250
+ const r3b: i32 = toI32(r3f) & 0xff
1251
+ const r3a: i32 = toI32(r3f >>> 8) & 0xff
1233
1252
  l3 ^= st[3126 + n + 1] ^ (((st[3144 + r3a] + st[3400 + r3b]) ^ st[3656 + r3c]) + st[3912 + r3d])
1234
1253
  }
1235
1254
  const t0: u32 = r0
@@ -1277,65 +1296,75 @@ const bcryptBody5 = (st: u32[]): void => {
1277
1296
  l3 ^= st[3126]
1278
1297
  l4 ^= st[4168]
1279
1298
  for (let n: i32 = 1; n < 17; n += 2) {
1280
- const l0e: u32 = ctSelect((l0 >>> 8) | (l0 << 24), 0xffffffff, 0)
1281
- const l0a: i32 = toI32(l0 >>> 24) & 0xff
1282
- const l0b: i32 = toI32(l0e >>> 8) & 0xff
1283
- const l0c: i32 = toI32(l0e) & 0xff
1284
- const l0d: i32 = toI32(l0) & 0xff
1299
+ const l0e: u32 = ctSelect(l0, 0xffffffff, 0)
1300
+ const l0d: i32 = toI32(l0e) & 0xff
1301
+ const l0c: i32 = toI32(l0e >>> 8) & 0xff
1302
+ const l0f: u32 = ctSelect(l0e >>> 16, 0xffffffff, 0)
1303
+ const l0b: i32 = toI32(l0f) & 0xff
1304
+ const l0a: i32 = toI32(l0f >>> 8) & 0xff
1285
1305
  r0 ^= st[n] ^ (((st[18 + l0a] + st[274 + l0b]) ^ st[530 + l0c]) + st[786 + l0d])
1286
- const l1e: u32 = ctSelect((l1 >>> 8) | (l1 << 24), 0xffffffff, 0)
1287
- const l1a: i32 = toI32(l1 >>> 24) & 0xff
1288
- const l1b: i32 = toI32(l1e >>> 8) & 0xff
1289
- const l1c: i32 = toI32(l1e) & 0xff
1290
- const l1d: i32 = toI32(l1) & 0xff
1306
+ const l1e: u32 = ctSelect(l1, 0xffffffff, 0)
1307
+ const l1d: i32 = toI32(l1e) & 0xff
1308
+ const l1c: i32 = toI32(l1e >>> 8) & 0xff
1309
+ const l1f: u32 = ctSelect(l1e >>> 16, 0xffffffff, 0)
1310
+ const l1b: i32 = toI32(l1f) & 0xff
1311
+ const l1a: i32 = toI32(l1f >>> 8) & 0xff
1291
1312
  r1 ^= st[1042 + n] ^ (((st[1060 + l1a] + st[1316 + l1b]) ^ st[1572 + l1c]) + st[1828 + l1d])
1292
- const l2e: u32 = ctSelect((l2 >>> 8) | (l2 << 24), 0xffffffff, 0)
1293
- const l2a: i32 = toI32(l2 >>> 24) & 0xff
1294
- const l2b: i32 = toI32(l2e >>> 8) & 0xff
1295
- const l2c: i32 = toI32(l2e) & 0xff
1296
- const l2d: i32 = toI32(l2) & 0xff
1313
+ const l2e: u32 = ctSelect(l2, 0xffffffff, 0)
1314
+ const l2d: i32 = toI32(l2e) & 0xff
1315
+ const l2c: i32 = toI32(l2e >>> 8) & 0xff
1316
+ const l2f: u32 = ctSelect(l2e >>> 16, 0xffffffff, 0)
1317
+ const l2b: i32 = toI32(l2f) & 0xff
1318
+ const l2a: i32 = toI32(l2f >>> 8) & 0xff
1297
1319
  r2 ^= st[2084 + n] ^ (((st[2102 + l2a] + st[2358 + l2b]) ^ st[2614 + l2c]) + st[2870 + l2d])
1298
- const l3e: u32 = ctSelect((l3 >>> 8) | (l3 << 24), 0xffffffff, 0)
1299
- const l3a: i32 = toI32(l3 >>> 24) & 0xff
1300
- const l3b: i32 = toI32(l3e >>> 8) & 0xff
1301
- const l3c: i32 = toI32(l3e) & 0xff
1302
- const l3d: i32 = toI32(l3) & 0xff
1320
+ const l3e: u32 = ctSelect(l3, 0xffffffff, 0)
1321
+ const l3d: i32 = toI32(l3e) & 0xff
1322
+ const l3c: i32 = toI32(l3e >>> 8) & 0xff
1323
+ const l3f: u32 = ctSelect(l3e >>> 16, 0xffffffff, 0)
1324
+ const l3b: i32 = toI32(l3f) & 0xff
1325
+ const l3a: i32 = toI32(l3f >>> 8) & 0xff
1303
1326
  r3 ^= st[3126 + n] ^ (((st[3144 + l3a] + st[3400 + l3b]) ^ st[3656 + l3c]) + st[3912 + l3d])
1304
- const l4e: u32 = ctSelect((l4 >>> 8) | (l4 << 24), 0xffffffff, 0)
1305
- const l4a: i32 = toI32(l4 >>> 24) & 0xff
1306
- const l4b: i32 = toI32(l4e >>> 8) & 0xff
1307
- const l4c: i32 = toI32(l4e) & 0xff
1308
- const l4d: i32 = toI32(l4) & 0xff
1327
+ const l4e: u32 = ctSelect(l4, 0xffffffff, 0)
1328
+ const l4d: i32 = toI32(l4e) & 0xff
1329
+ const l4c: i32 = toI32(l4e >>> 8) & 0xff
1330
+ const l4f: u32 = ctSelect(l4e >>> 16, 0xffffffff, 0)
1331
+ const l4b: i32 = toI32(l4f) & 0xff
1332
+ const l4a: i32 = toI32(l4f >>> 8) & 0xff
1309
1333
  r4 ^= st[4168 + n] ^ (((st[4186 + l4a] + st[4442 + l4b]) ^ st[4698 + l4c]) + st[4954 + l4d])
1310
- const r0e: u32 = ctSelect((r0 >>> 8) | (r0 << 24), 0xffffffff, 0)
1311
- const r0a: i32 = toI32(r0 >>> 24) & 0xff
1312
- const r0b: i32 = toI32(r0e >>> 8) & 0xff
1313
- const r0c: i32 = toI32(r0e) & 0xff
1314
- const r0d: i32 = toI32(r0) & 0xff
1334
+ const r0e: u32 = ctSelect(r0, 0xffffffff, 0)
1335
+ const r0d: i32 = toI32(r0e) & 0xff
1336
+ const r0c: i32 = toI32(r0e >>> 8) & 0xff
1337
+ const r0f: u32 = ctSelect(r0e >>> 16, 0xffffffff, 0)
1338
+ const r0b: i32 = toI32(r0f) & 0xff
1339
+ const r0a: i32 = toI32(r0f >>> 8) & 0xff
1315
1340
  l0 ^= st[n + 1] ^ (((st[18 + r0a] + st[274 + r0b]) ^ st[530 + r0c]) + st[786 + r0d])
1316
- const r1e: u32 = ctSelect((r1 >>> 8) | (r1 << 24), 0xffffffff, 0)
1317
- const r1a: i32 = toI32(r1 >>> 24) & 0xff
1318
- const r1b: i32 = toI32(r1e >>> 8) & 0xff
1319
- const r1c: i32 = toI32(r1e) & 0xff
1320
- const r1d: i32 = toI32(r1) & 0xff
1341
+ const r1e: u32 = ctSelect(r1, 0xffffffff, 0)
1342
+ const r1d: i32 = toI32(r1e) & 0xff
1343
+ const r1c: i32 = toI32(r1e >>> 8) & 0xff
1344
+ const r1f: u32 = ctSelect(r1e >>> 16, 0xffffffff, 0)
1345
+ const r1b: i32 = toI32(r1f) & 0xff
1346
+ const r1a: i32 = toI32(r1f >>> 8) & 0xff
1321
1347
  l1 ^= st[1042 + n + 1] ^ (((st[1060 + r1a] + st[1316 + r1b]) ^ st[1572 + r1c]) + st[1828 + r1d])
1322
- const r2e: u32 = ctSelect((r2 >>> 8) | (r2 << 24), 0xffffffff, 0)
1323
- const r2a: i32 = toI32(r2 >>> 24) & 0xff
1324
- const r2b: i32 = toI32(r2e >>> 8) & 0xff
1325
- const r2c: i32 = toI32(r2e) & 0xff
1326
- const r2d: i32 = toI32(r2) & 0xff
1348
+ const r2e: u32 = ctSelect(r2, 0xffffffff, 0)
1349
+ const r2d: i32 = toI32(r2e) & 0xff
1350
+ const r2c: i32 = toI32(r2e >>> 8) & 0xff
1351
+ const r2f: u32 = ctSelect(r2e >>> 16, 0xffffffff, 0)
1352
+ const r2b: i32 = toI32(r2f) & 0xff
1353
+ const r2a: i32 = toI32(r2f >>> 8) & 0xff
1327
1354
  l2 ^= st[2084 + n + 1] ^ (((st[2102 + r2a] + st[2358 + r2b]) ^ st[2614 + r2c]) + st[2870 + r2d])
1328
- const r3e: u32 = ctSelect((r3 >>> 8) | (r3 << 24), 0xffffffff, 0)
1329
- const r3a: i32 = toI32(r3 >>> 24) & 0xff
1330
- const r3b: i32 = toI32(r3e >>> 8) & 0xff
1331
- const r3c: i32 = toI32(r3e) & 0xff
1332
- const r3d: i32 = toI32(r3) & 0xff
1355
+ const r3e: u32 = ctSelect(r3, 0xffffffff, 0)
1356
+ const r3d: i32 = toI32(r3e) & 0xff
1357
+ const r3c: i32 = toI32(r3e >>> 8) & 0xff
1358
+ const r3f: u32 = ctSelect(r3e >>> 16, 0xffffffff, 0)
1359
+ const r3b: i32 = toI32(r3f) & 0xff
1360
+ const r3a: i32 = toI32(r3f >>> 8) & 0xff
1333
1361
  l3 ^= st[3126 + n + 1] ^ (((st[3144 + r3a] + st[3400 + r3b]) ^ st[3656 + r3c]) + st[3912 + r3d])
1334
- const r4e: u32 = ctSelect((r4 >>> 8) | (r4 << 24), 0xffffffff, 0)
1335
- const r4a: i32 = toI32(r4 >>> 24) & 0xff
1336
- const r4b: i32 = toI32(r4e >>> 8) & 0xff
1337
- const r4c: i32 = toI32(r4e) & 0xff
1338
- const r4d: i32 = toI32(r4) & 0xff
1362
+ const r4e: u32 = ctSelect(r4, 0xffffffff, 0)
1363
+ const r4d: i32 = toI32(r4e) & 0xff
1364
+ const r4c: i32 = toI32(r4e >>> 8) & 0xff
1365
+ const r4f: u32 = ctSelect(r4e >>> 16, 0xffffffff, 0)
1366
+ const r4b: i32 = toI32(r4f) & 0xff
1367
+ const r4a: i32 = toI32(r4f >>> 8) & 0xff
1339
1368
  l4 ^= st[4168 + n + 1] ^ (((st[4186 + r4a] + st[4442 + r4b]) ^ st[4698 + r4c]) + st[4954 + r4d])
1340
1369
  }
1341
1370
  const t0: u32 = r0
@@ -1391,35 +1420,40 @@ const bcryptBody6 = (st: u32[]): void => {
1391
1420
  l4 ^= st[4168]
1392
1421
  l5 ^= st[5210]
1393
1422
  for (let n: i32 = 1; n < 17; n += 2) {
1394
- const l0e: u32 = ctSelect(l0 >>> 8, 0xffffffff, 0)
1395
- const l0a: i32 = toI32(l0 >>> 24) & 0xff
1396
- const l0b: i32 = toI32(l0e >>> 8) & 0xff
1397
- const l0c: i32 = toI32(l0e) & 0xff
1398
- const l0d: i32 = toI32(l0) & 0xff
1423
+ const l0e: u32 = ctSelect(l0, 0xffffffff, 0)
1424
+ const l0d: i32 = toI32(l0e) & 0xff
1425
+ const l0c: i32 = toI32(l0e >>> 8) & 0xff
1426
+ const l0f: u32 = ctSelect(l0e >>> 16, 0xffffffff, 0)
1427
+ const l0b: i32 = toI32(l0f) & 0xff
1428
+ const l0a: i32 = toI32(l0f >>> 8) & 0xff
1399
1429
  r0 ^= st[n] ^ (((st[18 + l0a] + st[274 + l0b]) ^ st[530 + l0c]) + st[786 + l0d])
1400
- const l1e: u32 = ctSelect(l1 >>> 8, 0xffffffff, 0)
1401
- const l1a: i32 = toI32(l1 >>> 24) & 0xff
1402
- const l1b: i32 = toI32(l1e >>> 8) & 0xff
1403
- const l1c: i32 = toI32(l1e) & 0xff
1404
- const l1d: i32 = toI32(l1) & 0xff
1430
+ const l1e: u32 = ctSelect(l1, 0xffffffff, 0)
1431
+ const l1d: i32 = toI32(l1e) & 0xff
1432
+ const l1c: i32 = toI32(l1e >>> 8) & 0xff
1433
+ const l1f: u32 = ctSelect(l1e >>> 16, 0xffffffff, 0)
1434
+ const l1b: i32 = toI32(l1f) & 0xff
1435
+ const l1a: i32 = toI32(l1f >>> 8) & 0xff
1405
1436
  r1 ^= st[1042 + n] ^ (((st[1060 + l1a] + st[1316 + l1b]) ^ st[1572 + l1c]) + st[1828 + l1d])
1406
- const l2e: u32 = ctSelect(l2 >>> 8, 0xffffffff, 0)
1407
- const l2a: i32 = toI32(l2 >>> 24) & 0xff
1408
- const l2b: i32 = toI32(l2e >>> 8) & 0xff
1409
- const l2c: i32 = toI32(l2e) & 0xff
1410
- const l2d: i32 = toI32(l2) & 0xff
1437
+ const l2e: u32 = ctSelect(l2, 0xffffffff, 0)
1438
+ const l2d: i32 = toI32(l2e) & 0xff
1439
+ const l2c: i32 = toI32(l2e >>> 8) & 0xff
1440
+ const l2f: u32 = ctSelect(l2e >>> 16, 0xffffffff, 0)
1441
+ const l2b: i32 = toI32(l2f) & 0xff
1442
+ const l2a: i32 = toI32(l2f >>> 8) & 0xff
1411
1443
  r2 ^= st[2084 + n] ^ (((st[2102 + l2a] + st[2358 + l2b]) ^ st[2614 + l2c]) + st[2870 + l2d])
1412
- const l3e: u32 = ctSelect(l3 >>> 8, 0xffffffff, 0)
1413
- const l3a: i32 = toI32(l3 >>> 24) & 0xff
1414
- const l3b: i32 = toI32(l3e >>> 8) & 0xff
1415
- const l3c: i32 = toI32(l3e) & 0xff
1416
- const l3d: i32 = toI32(l3) & 0xff
1444
+ const l3e: u32 = ctSelect(l3, 0xffffffff, 0)
1445
+ const l3d: i32 = toI32(l3e) & 0xff
1446
+ const l3c: i32 = toI32(l3e >>> 8) & 0xff
1447
+ const l3f: u32 = ctSelect(l3e >>> 16, 0xffffffff, 0)
1448
+ const l3b: i32 = toI32(l3f) & 0xff
1449
+ const l3a: i32 = toI32(l3f >>> 8) & 0xff
1417
1450
  r3 ^= st[3126 + n] ^ (((st[3144 + l3a] + st[3400 + l3b]) ^ st[3656 + l3c]) + st[3912 + l3d])
1418
- const l4e: u32 = ctSelect(l4 >>> 8, 0xffffffff, 0)
1419
- const l4a: i32 = toI32(l4 >>> 24) & 0xff
1420
- const l4b: i32 = toI32(l4e >>> 8) & 0xff
1421
- const l4c: i32 = toI32(l4e) & 0xff
1422
- const l4d: i32 = toI32(l4) & 0xff
1451
+ const l4e: u32 = ctSelect(l4, 0xffffffff, 0)
1452
+ const l4d: i32 = toI32(l4e) & 0xff
1453
+ const l4c: i32 = toI32(l4e >>> 8) & 0xff
1454
+ const l4f: u32 = ctSelect(l4e >>> 16, 0xffffffff, 0)
1455
+ const l4b: i32 = toI32(l4f) & 0xff
1456
+ const l4a: i32 = toI32(l4f >>> 8) & 0xff
1423
1457
  r4 ^= st[4168 + n] ^ (((st[4186 + l4a] + st[4442 + l4b]) ^ st[4698 + l4c]) + st[4954 + l4d])
1424
1458
  const l5e: u32 = ctSelect(l5 >>> 8, 0xffffffff, 0)
1425
1459
  const l5a: i32 = toI32(l5 >>> 24) & 0xff
@@ -1427,35 +1461,40 @@ const bcryptBody6 = (st: u32[]): void => {
1427
1461
  const l5c: i32 = toI32(l5e) & 0xff
1428
1462
  const l5d: i32 = toI32(l5) & 0xff
1429
1463
  r5 ^= st[5210 + n] ^ (((st[5228 + l5a] + st[5484 + l5b]) ^ st[5740 + l5c]) + st[5996 + l5d])
1430
- const r0e: u32 = ctSelect(r0 >>> 8, 0xffffffff, 0)
1431
- const r0a: i32 = toI32(r0 >>> 24) & 0xff
1432
- const r0b: i32 = toI32(r0e >>> 8) & 0xff
1433
- const r0c: i32 = toI32(r0e) & 0xff
1434
- const r0d: i32 = toI32(r0) & 0xff
1464
+ const r0e: u32 = ctSelect(r0, 0xffffffff, 0)
1465
+ const r0d: i32 = toI32(r0e) & 0xff
1466
+ const r0c: i32 = toI32(r0e >>> 8) & 0xff
1467
+ const r0f: u32 = ctSelect(r0e >>> 16, 0xffffffff, 0)
1468
+ const r0b: i32 = toI32(r0f) & 0xff
1469
+ const r0a: i32 = toI32(r0f >>> 8) & 0xff
1435
1470
  l0 ^= st[n + 1] ^ (((st[18 + r0a] + st[274 + r0b]) ^ st[530 + r0c]) + st[786 + r0d])
1436
- const r1e: u32 = ctSelect(r1 >>> 8, 0xffffffff, 0)
1437
- const r1a: i32 = toI32(r1 >>> 24) & 0xff
1438
- const r1b: i32 = toI32(r1e >>> 8) & 0xff
1439
- const r1c: i32 = toI32(r1e) & 0xff
1440
- const r1d: i32 = toI32(r1) & 0xff
1471
+ const r1e: u32 = ctSelect(r1, 0xffffffff, 0)
1472
+ const r1d: i32 = toI32(r1e) & 0xff
1473
+ const r1c: i32 = toI32(r1e >>> 8) & 0xff
1474
+ const r1f: u32 = ctSelect(r1e >>> 16, 0xffffffff, 0)
1475
+ const r1b: i32 = toI32(r1f) & 0xff
1476
+ const r1a: i32 = toI32(r1f >>> 8) & 0xff
1441
1477
  l1 ^= st[1042 + n + 1] ^ (((st[1060 + r1a] + st[1316 + r1b]) ^ st[1572 + r1c]) + st[1828 + r1d])
1442
- const r2e: u32 = ctSelect(r2 >>> 8, 0xffffffff, 0)
1443
- const r2a: i32 = toI32(r2 >>> 24) & 0xff
1444
- const r2b: i32 = toI32(r2e >>> 8) & 0xff
1445
- const r2c: i32 = toI32(r2e) & 0xff
1446
- const r2d: i32 = toI32(r2) & 0xff
1478
+ const r2e: u32 = ctSelect(r2, 0xffffffff, 0)
1479
+ const r2d: i32 = toI32(r2e) & 0xff
1480
+ const r2c: i32 = toI32(r2e >>> 8) & 0xff
1481
+ const r2f: u32 = ctSelect(r2e >>> 16, 0xffffffff, 0)
1482
+ const r2b: i32 = toI32(r2f) & 0xff
1483
+ const r2a: i32 = toI32(r2f >>> 8) & 0xff
1447
1484
  l2 ^= st[2084 + n + 1] ^ (((st[2102 + r2a] + st[2358 + r2b]) ^ st[2614 + r2c]) + st[2870 + r2d])
1448
- const r3e: u32 = ctSelect(r3 >>> 8, 0xffffffff, 0)
1449
- const r3a: i32 = toI32(r3 >>> 24) & 0xff
1450
- const r3b: i32 = toI32(r3e >>> 8) & 0xff
1451
- const r3c: i32 = toI32(r3e) & 0xff
1452
- const r3d: i32 = toI32(r3) & 0xff
1485
+ const r3e: u32 = ctSelect(r3, 0xffffffff, 0)
1486
+ const r3d: i32 = toI32(r3e) & 0xff
1487
+ const r3c: i32 = toI32(r3e >>> 8) & 0xff
1488
+ const r3f: u32 = ctSelect(r3e >>> 16, 0xffffffff, 0)
1489
+ const r3b: i32 = toI32(r3f) & 0xff
1490
+ const r3a: i32 = toI32(r3f >>> 8) & 0xff
1453
1491
  l3 ^= st[3126 + n + 1] ^ (((st[3144 + r3a] + st[3400 + r3b]) ^ st[3656 + r3c]) + st[3912 + r3d])
1454
- const r4e: u32 = ctSelect(r4 >>> 8, 0xffffffff, 0)
1455
- const r4a: i32 = toI32(r4 >>> 24) & 0xff
1456
- const r4b: i32 = toI32(r4e >>> 8) & 0xff
1457
- const r4c: i32 = toI32(r4e) & 0xff
1458
- const r4d: i32 = toI32(r4) & 0xff
1492
+ const r4e: u32 = ctSelect(r4, 0xffffffff, 0)
1493
+ const r4d: i32 = toI32(r4e) & 0xff
1494
+ const r4c: i32 = toI32(r4e >>> 8) & 0xff
1495
+ const r4f: u32 = ctSelect(r4e >>> 16, 0xffffffff, 0)
1496
+ const r4b: i32 = toI32(r4f) & 0xff
1497
+ const r4a: i32 = toI32(r4f >>> 8) & 0xff
1459
1498
  l4 ^= st[4168 + n + 1] ^ (((st[4186 + r4a] + st[4442 + r4b]) ^ st[4698 + r4c]) + st[4954 + r4d])
1460
1499
  const r5e: u32 = ctSelect(r5 >>> 8, 0xffffffff, 0)
1461
1500
  const r5a: i32 = toI32(r5 >>> 24) & 0xff