INNER CODE UNIT · TypeScript

main

paulmillr/noble-ciphers · benchmark/thirdparty/index.ts:548

export async function main() {
  const ctx = chainsafe_init_wasm();
  chainsafe_chacha_poly = new ChsfChachaPoly(ctx);

  // Usage:
  // Basic: node basic.js
  // Complex: JSBT_ORDER='size,type,padding,key size,algorithm,library,direction' node basic.js
  // NOTE: encrypted buffers must be precomputed here, since decrypt cases need valid ciphertexts.
  const encrypted = {};
  for (const [type, algorithms] of Object.entries(CIPHERS)) {
    for (const [algo, paddings] of Object.entries(algorithms)) {
      for (const [padding, keySizes] of Object.entries(paddings)) {
        for (const [keySize, libraries] of Object.entries(keySizes)) {
          const name = `${type}/${algo}/${padding}/${keySize}`;
          encrypted[name] = await crossValidate(
            `${type}/${algo}/${padding}/${keySize}`,
            SIZES,
            libraries

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…