"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/ecc-jsbn/test.js" (11 Apr 2017, 682 Bytes) of package /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 var ecc = require("./index.js");
    2 var key1 = new ecc.ECKey(ecc.ECCurves.secp160r1);
    3 var key2 = new ecc.ECKey(ecc.ECCurves.secp160r1);
    4 console.log(key1.deriveSharedSecret(key2));
    5 var key3 = new ecc.ECKey(ecc.ECCurves.secp160r1,key1.PrivateKey);
    6 var key4 = new ecc.ECKey(ecc.ECCurves.secp160r1,key2.PublicKey,true);
    7 console.log(key3.deriveSharedSecret(key4));
    8 
    9 var key1 = new ecc.ECKey(ecc.ECCurves.secp256r1);
   10 var key2 = new ecc.ECKey(ecc.ECCurves.secp256r1);
   11 console.log(key1.deriveSharedSecret(key2));
   12 var key3 = new ecc.ECKey(ecc.ECCurves.secp256r1,key1.PrivateKey);
   13 var key4 = new ecc.ECKey(ecc.ECCurves.secp256r1,key2.PublicKey,true);
   14 console.log(key3.deriveSharedSecret(key4));