From b57960c33c516b74bfc84541793c5b6213200ee9 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Thu, 19 Oct 2023 18:43:12 +0200 Subject: [PATCH] Fix readme --- README.md | 1 - benchmark/aes.js | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cc6d311..e7bedae 100644 --- a/README.md +++ b/README.md @@ -553,7 +553,6 @@ ctr-256 (encrypt, 1MB) ├─noble-webcrypto x 4,589 ops/sec @ 217μs/op └─noble x 107 ops/sec @ 9ms/op -==== cbc-256 ==== cbc-256 (encrypt, 1MB) ├─node x 993 ops/sec @ 1ms/op ├─stablelib x 63 ops/sec @ 15ms/op diff --git a/benchmark/aes.js b/benchmark/aes.js index 72ec20a..79284b3 100644 --- a/benchmark/aes.js +++ b/benchmark/aes.js @@ -162,7 +162,7 @@ export const CIPHERS = { encrypt: (buf, opts) => new aesjs.ModeOfOperation.ctr(opts.key, opts.iv).encrypt(buf), decrypt: (buf, opts) => new aesjs.ModeOfOperation.ctr(opts.key, opts.iv).decrypt(buf), }, - nobleOld: { + 'noble-webcrypto': { encrypt: (buf, opts) => webcrypto.ctr(opts.key, opts.iv).encrypt(buf), decrypt: (buf, opts) => webcrypto.ctr(opts.key, opts.iv).decrypt(buf), }, @@ -179,7 +179,7 @@ export const CIPHERS = { encrypt: (buf, opts) => new aesjs.ModeOfOperation.ctr(opts.key, opts.iv).encrypt(buf), decrypt: (buf, opts) => new aesjs.ModeOfOperation.ctr(opts.key, opts.iv).decrypt(buf), }, - nobleOld: { + 'noble-webcrypto': { encrypt: (buf, opts) => webcrypto.ctr(opts.key, opts.iv).encrypt(buf), decrypt: (buf, opts) => webcrypto.ctr(opts.key, opts.iv).decrypt(buf), }, @@ -198,7 +198,7 @@ export const CIPHERS = { decrypt: (buf, opts) => aesjs.padding.pkcs7.strip(new aesjs.ModeOfOperation.cbc(opts.key, opts.iv).decrypt(buf)), }, - nobleOld: { + 'noble-webcrypto': { encrypt: (buf, opts) => webcrypto.cbc(opts.key, opts.iv).encrypt(buf), decrypt: (buf, opts) => webcrypto.cbc(opts.key, opts.iv).decrypt(buf), }, @@ -217,7 +217,7 @@ export const CIPHERS = { decrypt: (buf, opts) => aesjs.padding.pkcs7.strip(new aesjs.ModeOfOperation.cbc(opts.key, opts.iv).decrypt(buf)), }, - nobleOld: { + 'noble-webcrypto': { encrypt: (buf, opts) => webcrypto.cbc(opts.key, opts.iv).encrypt(buf), decrypt: (buf, opts) => webcrypto.cbc(opts.key, opts.iv).decrypt(buf), }, @@ -313,7 +313,7 @@ export const CIPHERS = { encrypt: (buf, opts) => new STABLE_GCM(new STABLE_AES(opts.key)).seal(opts.iv, buf), decrypt: (buf, opts) => new STABLE_GCM(new STABLE_AES(opts.key)).open(opts.iv, buf), }, - nobleOld: { + 'noble-webcrypto': { encrypt: (buf, opts) => webcrypto.gcm(opts.key, opts.iv).encrypt(buf), decrypt: (buf, opts) => webcrypto.gcm(opts.key, opts.iv).decrypt(buf), }, @@ -329,7 +329,7 @@ export const CIPHERS = { encrypt: (buf, opts) => new STABLE_GCM(new STABLE_AES(opts.key)).seal(opts.iv, buf), decrypt: (buf, opts) => new STABLE_GCM(new STABLE_AES(opts.key)).open(opts.iv, buf), }, - nobleOld: { + 'noble-webcrypto': { encrypt: (buf, opts) => webcrypto.gcm(opts.key, opts.iv).encrypt(buf), decrypt: (buf, opts) => webcrypto.gcm(opts.key, opts.iv).decrypt(buf), },