@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.
- package/INSTALL.md +16 -12
- package/bin/nish +0 -0
- package/docs/AI.md +77 -14
- package/package.json +1 -1
- package/runtime/async.d.mts +49 -0
- package/runtime/async.mjs +27 -0
- package/runtime/nish.d.ts +72 -0
- package/runtime/nish.h +6 -2
- package/runtime/nish.mjs +4 -0
- package/runtime/runtime-net.c +22 -0
- package/runtime/runtime-shm.c +93 -2
- package/std/README.md +131 -131
- package/std/bytes.ts +28 -5
- package/std/crypto/base64url.ts +42 -21
- package/std/crypto/bcrypt.ts +222 -183
- package/std/net/http1-codec.ts +262 -92
- package/std/net/http1-server.ts +87 -9
- package/std/net/http3-server.ts +30 -6
- package/std/net/postgres.ts +129 -40
- package/std/net/quic-recovery.ts +36 -8
- package/std/net/quic.ts +664 -59
- package/std/sync/ring.ts +236 -16
- package/std/sync/shm.ts +29 -0
package/std/crypto/bcrypt.ts
CHANGED
|
@@ -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
|
|
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
|
-
//
|
|
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(
|
|
1095
|
-
const
|
|
1096
|
-
const
|
|
1097
|
-
const
|
|
1098
|
-
const
|
|
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(
|
|
1101
|
-
const
|
|
1102
|
-
const
|
|
1103
|
-
const
|
|
1104
|
-
const
|
|
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(
|
|
1107
|
-
const
|
|
1108
|
-
const
|
|
1109
|
-
const
|
|
1110
|
-
const
|
|
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(
|
|
1113
|
-
const
|
|
1114
|
-
const
|
|
1115
|
-
const
|
|
1116
|
-
const
|
|
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(
|
|
1119
|
-
const
|
|
1120
|
-
const
|
|
1121
|
-
const
|
|
1122
|
-
const
|
|
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(
|
|
1125
|
-
const
|
|
1126
|
-
const
|
|
1127
|
-
const
|
|
1128
|
-
const
|
|
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
|
|
1157
|
-
*
|
|
1158
|
-
*
|
|
1159
|
-
*
|
|
1160
|
-
*
|
|
1161
|
-
*
|
|
1162
|
-
*
|
|
1163
|
-
*
|
|
1164
|
-
*
|
|
1165
|
-
*
|
|
1166
|
-
* the
|
|
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(
|
|
1187
|
-
const
|
|
1188
|
-
const
|
|
1189
|
-
const
|
|
1190
|
-
const
|
|
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(
|
|
1193
|
-
const
|
|
1194
|
-
const
|
|
1195
|
-
const
|
|
1196
|
-
const
|
|
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(
|
|
1199
|
-
const
|
|
1200
|
-
const
|
|
1201
|
-
const
|
|
1202
|
-
const
|
|
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(
|
|
1205
|
-
const
|
|
1206
|
-
const
|
|
1207
|
-
const
|
|
1208
|
-
const
|
|
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(
|
|
1211
|
-
const
|
|
1212
|
-
const
|
|
1213
|
-
const
|
|
1214
|
-
const
|
|
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(
|
|
1217
|
-
const
|
|
1218
|
-
const
|
|
1219
|
-
const
|
|
1220
|
-
const
|
|
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(
|
|
1223
|
-
const
|
|
1224
|
-
const
|
|
1225
|
-
const
|
|
1226
|
-
const
|
|
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(
|
|
1229
|
-
const
|
|
1230
|
-
const
|
|
1231
|
-
const
|
|
1232
|
-
const
|
|
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(
|
|
1281
|
-
const
|
|
1282
|
-
const
|
|
1283
|
-
const
|
|
1284
|
-
const
|
|
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(
|
|
1287
|
-
const
|
|
1288
|
-
const
|
|
1289
|
-
const
|
|
1290
|
-
const
|
|
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(
|
|
1293
|
-
const
|
|
1294
|
-
const
|
|
1295
|
-
const
|
|
1296
|
-
const
|
|
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(
|
|
1299
|
-
const
|
|
1300
|
-
const
|
|
1301
|
-
const
|
|
1302
|
-
const
|
|
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(
|
|
1305
|
-
const
|
|
1306
|
-
const
|
|
1307
|
-
const
|
|
1308
|
-
const
|
|
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(
|
|
1311
|
-
const
|
|
1312
|
-
const
|
|
1313
|
-
const
|
|
1314
|
-
const
|
|
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(
|
|
1317
|
-
const
|
|
1318
|
-
const
|
|
1319
|
-
const
|
|
1320
|
-
const
|
|
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(
|
|
1323
|
-
const
|
|
1324
|
-
const
|
|
1325
|
-
const
|
|
1326
|
-
const
|
|
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(
|
|
1329
|
-
const
|
|
1330
|
-
const
|
|
1331
|
-
const
|
|
1332
|
-
const
|
|
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(
|
|
1335
|
-
const
|
|
1336
|
-
const
|
|
1337
|
-
const
|
|
1338
|
-
const
|
|
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
|
|
1395
|
-
const
|
|
1396
|
-
const
|
|
1397
|
-
const
|
|
1398
|
-
const
|
|
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
|
|
1401
|
-
const
|
|
1402
|
-
const
|
|
1403
|
-
const
|
|
1404
|
-
const
|
|
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
|
|
1407
|
-
const
|
|
1408
|
-
const
|
|
1409
|
-
const
|
|
1410
|
-
const
|
|
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
|
|
1413
|
-
const
|
|
1414
|
-
const
|
|
1415
|
-
const
|
|
1416
|
-
const
|
|
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
|
|
1419
|
-
const
|
|
1420
|
-
const
|
|
1421
|
-
const
|
|
1422
|
-
const
|
|
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
|
|
1431
|
-
const
|
|
1432
|
-
const
|
|
1433
|
-
const
|
|
1434
|
-
const
|
|
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
|
|
1437
|
-
const
|
|
1438
|
-
const
|
|
1439
|
-
const
|
|
1440
|
-
const
|
|
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
|
|
1443
|
-
const
|
|
1444
|
-
const
|
|
1445
|
-
const
|
|
1446
|
-
const
|
|
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
|
|
1449
|
-
const
|
|
1450
|
-
const
|
|
1451
|
-
const
|
|
1452
|
-
const
|
|
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
|
|
1455
|
-
const
|
|
1456
|
-
const
|
|
1457
|
-
const
|
|
1458
|
-
const
|
|
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
|