@bsv/sdk 1.9.15 → 1.9.16
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/dist/cjs/package.json +1 -1
- package/dist/cjs/src/primitives/AESGCM.js +4 -12
- package/dist/cjs/src/primitives/AESGCM.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/primitives/AESGCM.js +4 -12
- package/dist/esm/src/primitives/AESGCM.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/primitives/AESGCM.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/dist/umd/bundle.js.map +1 -1
- package/package.json +1 -1
- package/src/primitives/AESGCM.ts +5 -9
package/package.json
CHANGED
package/src/primitives/AESGCM.ts
CHANGED
|
@@ -143,20 +143,16 @@ export function AES (input: number[], key: number[]): number[] {
|
|
|
143
143
|
const state = [[], [], [], []]
|
|
144
144
|
const output = []
|
|
145
145
|
|
|
146
|
-
// Since the BigNumber representation of keys ignores big endian zeroes,
|
|
147
|
-
// extend incoming key arrays with zeros to the smallest standard key size.
|
|
148
146
|
const ekey = Array.from(key)
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
|
|
148
|
+
if (ekey.length === 16) {
|
|
151
149
|
roundLimit = 11
|
|
152
|
-
} else if (ekey.length
|
|
153
|
-
while (ekey.length < 24) ekey.unshift(0)
|
|
150
|
+
} else if (ekey.length === 24) {
|
|
154
151
|
roundLimit = 13
|
|
155
|
-
} else if (
|
|
156
|
-
while (ekey.length < 32) ekey.unshift(0)
|
|
152
|
+
} else if (ekey.length === 32) {
|
|
157
153
|
roundLimit = 15
|
|
158
154
|
} else {
|
|
159
|
-
throw new Error('Illegal key length: ' + String(
|
|
155
|
+
throw new Error('Illegal key length: ' + String(ekey.length))
|
|
160
156
|
}
|
|
161
157
|
|
|
162
158
|
const w = keyExpansion(roundLimit, ekey)
|