INNER CODE UNIT · TypeScript
N
StableLib/stablelib · packages/aes-kw/aes-kw.ts:58
const N = (keyData.length - (keyData.length % 8)) / 8;
// The keyData must be at minimum 128 bit (16 bytes) in length.
if (N <= 1) {
throw new Error("AESKW: key size must be at least 16 bytes");
}
// Set A to the initial value.
const A = new Uint8Array(this._iv);
// Initialize the length of the wrapped key, size always equals N+1.
const wrappedKey = new Uint8Array(8 * (N + 1));
// Set the plain text into the wrapped key array offset
// by one 64 bit data block.
wrappedKey.set(keyData, 8);
for (let j = 0; j < 6; j++) {