INNER CODE UNIT · TypeScript
wrappedKey
StableLib/stablelib · packages/aes-kw/aes-kw.ts:69
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++) {
for (let i = 1; i <= N; i++) {
this._inputBuffer.set(A);
this._inputBuffer.set(wrappedKey.subarray(i * 8, (i + 1) * 8), 8);
this._cipher.encryptBlock(this._inputBuffer, this._outputBuffer);
writeUint64BE(i + j * N, A);
xor(A, this._outputBuffer.subarray(0, 8));
wrappedKey.set(this._outputBuffer.subarray(8, 16), i * 8);
}
}
wrappedKey.set(A);