supercop.ts

cross-compiled javascript implementation of ed25519 based on supercop-ref10
git clone git://git.finwo.net/lib/supercop.ts
Log | Files | Refs | README | LICENSE

0008-memory-hammering.test.ts (439B)


      1 // This test was built based on a user-submitted bug: https://github.com/finwo/supercop/issues/4
      2 
      3 import tap = require('tap');
      4 import KeyPair, { createSeed } from '../src/index';
      5 
      6 (async () => {
      7 
      8   const kp = await KeyPair.create(createSeed());
      9 
     10   for(let size = 200; size <= 4096; size += 1) {
     11     const message = Buffer.alloc(size);
     12     await kp.sign(message);
     13   }
     14 
     15   tap.ok(true, 'Thread survived hammering supercop\'s memory');
     16 
     17 })();