mirror of
https://github.com/gchq/CyberChef
synced 2025-12-05 23:53:27 +00:00
Updated dependencies. Removed shim from HMAC op and postinstall js-to-mjs step due to CryptoAPI fixes.
This commit is contained in:
@@ -71,13 +71,6 @@ class HMAC extends Operation {
|
||||
msg = Utils.arrayBufferToStr(input, false),
|
||||
hasher = CryptoApi.getHasher(hashFunc);
|
||||
|
||||
// Horrible shim to fix constructor bug. Reported in nf404/crypto-api#8
|
||||
hasher.reset = () => {
|
||||
hasher.state = {};
|
||||
const tmp = new hasher.constructor();
|
||||
hasher.state = tmp.state;
|
||||
};
|
||||
|
||||
const mac = CryptoApi.getHmac(CryptoApi.encoder.fromUtf(key), hasher);
|
||||
mac.update(msg);
|
||||
return CryptoApi.encoder.toHex(mac.finalize());
|
||||
|
||||
Reference in New Issue
Block a user