chore: localfied react, react-dom and crypto-es

This commit is contained in:
CrescentLeaf
2025-09-06 23:28:50 +08:00
parent 22b8269c4b
commit b6140063c7
45 changed files with 26277 additions and 36 deletions

View File

@@ -0,0 +1,39 @@
import { BlockCipherMode } from "./cipher-core.mjs";
//#region src/mode-ctr.ts
/**
* CTR Encryptor/Decryptor (same operation)
*/
var CTRMode = class extends BlockCipherMode {
/** Counter for CTR mode */
_counter;
processBlock(words, offset) {
const _words = words;
const cipher = this._cipher;
const blockSize = cipher.blockSize;
const iv = this._iv;
let counter = this._counter;
if (iv) {
this._counter = iv.slice(0);
counter = this._counter;
this._iv = void 0;
}
const keystream = counter.slice(0);
cipher.encryptBlock(keystream, 0);
counter[blockSize - 1] = counter[blockSize - 1] + 1 | 0;
for (let i = 0; i < blockSize; i += 1) _words[offset + i] ^= keystream[i];
}
};
/**
* Counter block mode.
*/
var CTR = class extends BlockCipherMode {
/** Counter for CTR mode */
_counter;
static Encryptor = CTRMode;
static Decryptor = CTRMode;
};
//#endregion
export { CTR };
//# sourceMappingURL=mode-ctr.mjs.map