This commit is contained in:
2024-07-17 16:14:14 +08:00
commit 2ef3bcf322
1817 changed files with 63826 additions and 0 deletions

30
node_modules/crypto-es/lib/pad-iso10126.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import {
WordArray,
} from './core.js';
/**
* ISO 10126 padding strategy.
*/
export const Iso10126 = {
pad(data, blockSize) {
// Shortcut
const blockSizeBytes = blockSize * 4;
// Count padding bytes
const nPaddingBytes = blockSizeBytes - (data.sigBytes % blockSizeBytes);
// Pad
data
.concat(WordArray.random(nPaddingBytes - 1))
.concat(WordArray.create([nPaddingBytes << 24], 1));
},
unpad(data) {
const _data = data;
// Get number of padding bytes from last byte
const nPaddingBytes = _data.words[(_data.sigBytes - 1) >>> 2] & 0xff;
// Remove padding
_data.sigBytes -= nPaddingBytes;
},
};