0007-message-size-limit.test.ts (529B)
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 // Generates 8 loops, from 800..2000 11 for(let size = 800; size <= 2200; size += 200) { 12 const message = Buffer.alloc(size); 13 const signature_kp = await kp.sign(message); 14 tap.ok(signature_kp.length == 64, `kp.sign(${size}) returns buffer of 64 bytes`); 15 } 16 17 })();