INNER CODE UNIT · TypeScript

N

StableLib/stablelib · packages/aes-kw/aes-kw.ts:101

        const N = ((wrappedKey.length - (wrappedKey.length % 8)) / 8) - 1;

        // 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 first 64 bit data block of the wrapped key.
        const A = new Uint8Array(wrappedKey.subarray(0, 8));

        // Allocate temporary array.
        const tmp = new Uint8Array(8);

        // Initialize the length of the key data, size always equals N.
        const keyData = new Uint8Array(8 * N);
        const encryptedKeyData = new Uint8Array(wrappedKey);

        for (let j = 5; j >= 0; j--) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…