將部分依賴存放本地, 添加針對移動端的報錯提示, 修正 CryptoES 的導出以及 Utf8 的引用, 忽略編譯靜態庫文件

This commit is contained in:
CrescentLeaf
2025-09-06 22:09:33 +08:00
parent 3c02b55a9b
commit d0c9465498
44 changed files with 6251 additions and 14 deletions

View File

@@ -0,0 +1,40 @@
import { BlockCipherMode } from "./cipher-core.mjs";
//#region src/mode-ofb.ts
/**
* OFB Encryptor/Decryptor (same operation)
*/
var OFBMode = class extends BlockCipherMode {
/** Keystream for OFB mode */
_keystream;
processBlock(words, offset) {
const _words = words;
const cipher = this._cipher;
const blockSize = cipher.blockSize;
const iv = this._iv;
let keystream = this._keystream;
if (iv) {
this._keystream = iv.slice(0);
keystream = this._keystream;
this._iv = void 0;
} else if (!keystream) {
this._keystream = new Array(blockSize).fill(0);
keystream = this._keystream;
}
cipher.encryptBlock(keystream, 0);
for (let i = 0; i < blockSize; i += 1) _words[offset + i] ^= keystream[i];
}
};
/**
* Output Feedback block mode.
*/
var OFB = class extends BlockCipherMode {
/** Keystream for OFB mode */
_keystream;
static Encryptor = OFBMode;
static Decryptor = OFBMode;
};
//#endregion
export { OFB };
//# sourceMappingURL=mode-ofb.mjs.map