Rename operation

This commit is contained in:
Andy Wang 2020-01-14 10:48:25 +00:00
parent a6d85aff1b
commit 1bfd9eb7c9
5 changed files with 19 additions and 19 deletions

View file

@ -71,8 +71,8 @@
"AES Decrypt",
"Blowfish Encrypt",
"Blowfish Decrypt",
"Chacha20-Poly1305 Encrypt",
"Chacha20-Poly1305 Decrypt",
"Chacha20 Encrypt",
"Chacha20 Decrypt",
"DES Encrypt",
"DES Decrypt",
"Triple DES Encrypt",

View file

@ -11,17 +11,17 @@ import Chacha20 from "../lib/Chacha20";
import Chacha20Poly1305 from "../lib/Chacha20Poly1305";
/**
* Chacha20-Poly1305 Decrypt operation
* Chacha20 Decrypt operation
*/
class Chacha20Poly1305Decrypt extends Operation {
class Chacha20Decrypt extends Operation {
/**
* Chacha20Poly1305Decrypt constructor
* Chacha20Decrypt constructor
*/
constructor() {
super();
this.name = "Chacha20-Poly1305 Decrypt";
this.name = "Chacha20 Decrypt";
this.module = "Crypto";
this.description = "Chacha20 is a stream cipher developed by Daniel Bernstein based on Salsa20. The cipher and the massage authentication code Poly1305 are defined by RFC8439. Chacha20 and Poly1305 are frequently used together for authenticated encryption, and has been included in TLS 1.3 protocol.<br><br><b>Key:</b> Key length should be 32 bytes (256 bits).<br><br><b>Nonce:</b> The one-time nonce should be 8 or 12 bytes long (64 or 96 bits).";
this.infoURL = "https://tools.ietf.org/html/rfc8439";
@ -123,4 +123,4 @@ Poly1305 produces a 16 bytes long tag`);
}
}
export default Chacha20Poly1305Decrypt;
export default Chacha20Decrypt;

View file

@ -11,17 +11,17 @@ import Chacha20 from "../lib/Chacha20";
import Chacha20Poly1305 from "../lib/Chacha20Poly1305";
/**
* Chacha20-Poly1305 Encrypt operation
* Chacha20 Encrypt operation
*/
class Chacha20Poly1305Encrypt extends Operation {
class Chacha20Encrypt extends Operation {
/**
* Chacha20Poly1305Encrypt constructor
* Chacha20Encrypt constructor
*/
constructor() {
super();
this.name = "Chacha20-Poly1305 Encrypt";
this.name = "Chacha20 Encrypt";
this.module = "Crypto";
this.description = "Chacha20 is a stream cipher developed by Daniel Bernstein based on Salsa20. The cipher and the massage authentication code Poly1305 are defined by RFC8439. Chacha20 and Poly1305 are frequently used together for authenticated encryption, and has been included in TLS 1.3 protocol.<br><br><b>Key:</b> Key length should be 32 bytes (256 bits).<br><br><b>Nonce:</b> The one-time nonce should be 8 or 12 bytes long (64 or 96 bits).";
this.infoURL = "https://tools.ietf.org/html/rfc8439";
@ -114,4 +114,4 @@ Chacha20 requires a nonce length of 8 or 12 bytes`);
}
export default Chacha20Poly1305Encrypt;
export default Chacha20Encrypt;

View file

@ -233,7 +233,7 @@ Full hash: $2a$10$ODeP1.6fMsb.ENk2ngPUCO7qTGVPyHA9TqDVcyupyed8FjsiF65L6`;
}),
it("Chacha20 Encrypt", () => {
const result = chef.chacha20Poly1305Encrypt("Come out of the cupboard, you boys and girls", {
const result = chef.chacha20Encrypt("Come out of the cupboard, you boys and girls", {
key: {
string: "0011223344556677001122334455667700112233445566770011223344556677",
option: "hex",

View file

@ -8,7 +8,7 @@ TestRegister.addTests([
expectedOutput: "76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586",
recipeConfig: [
{
"op": "Chacha20-Poly1305 Encrypt",
"op": "Chacha20 Encrypt",
"args": [
{"option": "Hex", "string": "0000000000000000000000000000000000000000000000000000000000000000"}, // Key
{"option": "Hex", "string": "0000000000000000"}, // Nonce
@ -26,7 +26,7 @@ TestRegister.addTests([
expectedOutput: "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
recipeConfig: [
{
"op": "Chacha20-Poly1305 Decrypt",
"op": "Chacha20 Decrypt",
"args": [
{"option": "Hex", "string": "0000000000000000000000000000000000000000000000000000000000000000"}, // Key
{"option": "Hex", "string": "0000000000000000"}, // Nonce
@ -46,7 +46,7 @@ TestRegister.addTests([
expectedOutput: "4540f05a9f1fb296d7736e7b208e3c96eb4fe1834688d2604f450952ed432d41bbe2a0b6ea7566d2a5d1e7e20d42af2c53d792b1c43fea817e9ad275ae546963",
recipeConfig: [
{
"op": "Chacha20-Poly1305 Encrypt",
"op": "Chacha20 Encrypt",
"args": [
{"option": "Hex", "string": "0000000000000000000000000000000000000000000000000000000000000001"}, // Key
{"option": "Hex", "string": "0000000000000000"}, // Nonce
@ -64,7 +64,7 @@ TestRegister.addTests([
input: "4540f05a9f1fb296d7736e7b208e3c96eb4fe1834688d2604f450952ed432d41bbe2a0b6ea7566d2a5d1e7e20d42af2c53d792b1c43fea817e9ad275ae546963",
recipeConfig: [
{
"op": "Chacha20-Poly1305 Decrypt",
"op": "Chacha20 Decrypt",
"args": [
{"option": "Hex", "string": "0000000000000000000000000000000000000000000000000000000000000001"}, // Key
{"option": "Hex", "string": "0000000000000000"}, // Nonce
@ -85,7 +85,7 @@ TestRegister.addTests([
Tag: 1ae10b594f09e26a7e902ecbd0600691",
recipeConfig: [
{
"op": "Chacha20-Poly1305 Encrypt",
"op": "Chacha20 Encrypt",
"args": [
{"option": "Hex", "string": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f"}, // Key
{"option": "Hex", "string": "070000004041424344454647"}, // Nonce
@ -109,7 +109,7 @@ or obsoleted by other documents at any time. It is inappropriate to use Internet
other than as /work in progress./",
recipeConfig: [
{
"op": "Chacha20-Poly1305 Decrypt",
"op": "Chacha20 Decrypt",
"args": [
{"option": "Hex", "string": "1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0"}, // Key
{"option": "Hex", "string": "000000000102030405060708"}, // Nonce