mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 00:06:17 -04:00
Remove highlighting and correct one module mismatch
This commit is contained in:
parent
f61bdf06c6
commit
ae9054dc37
2 changed files with 11 additions and 22 deletions
|
@ -4,6 +4,7 @@
|
|||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import OperationError from "../errors/OperationError.mjs";
|
||||
import Operation from "../Operation.mjs";
|
||||
|
||||
import { SM2 } from "../lib/SM2.mjs";
|
||||
|
@ -54,6 +55,10 @@ class SM2Decrypt extends Operation {
|
|||
run(input, args) {
|
||||
const [privateKey, inputFormat, curveName] = args;
|
||||
|
||||
if (privateKey.length !== 64) {
|
||||
throw new OperationError("Input private key must be in hex; and should be 32 bytes");
|
||||
}
|
||||
|
||||
const sm2 = new SM2(curveName, inputFormat);
|
||||
sm2.setPrivateKey(privateKey);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue