Comments (7)
Please provide details of your platform and running environment.
from crystals-kyber-javascript.
I have tried the upper code in multiple envs like docker containers.
Steps to reproduce:
- install node
- npm install crystals-kyber
- create index.js with upper code
- add "type": "module" in package.json
- node index.js
from crystals-kyber-javascript.
@antontutoveanu help?
from crystals-kyber-javascript.
I have been able to run the code using node kyber768.js
for example.
I believe there is some npm issues which I plan on getting around. Apologies for delays.
from crystals-kyber-javascript.
I had the same issue, getting stuck at KeyGen, after some digging found that the culprit was this line:
for (let j = start; j < start + l; j++)
.
For some reason in the source code from the npm package the j
was declared twice: at the beginning of the ntt
function and in the for
loop again. After removing the let
in the for loop it worked. Github source code didn't have this issue though.
from crystals-kyber-javascript.
... same bug in nttInverse
function where the j
was declared twice (again only in npm's source code).
Also, ArrayCompare
was missing in npm code which I just copied over from Github.
from crystals-kyber-javascript.
I have updated the code on both GitHub and NPM.
Please check again with the following usage:
// Import package
const kyber = require('crystals-kyber');
// To generate a public and private key pair (pk, sk)
let pk_sk = kyber.KeyGen768();
let pk = pk_sk[0];
let sk = pk_sk[1];
// To generate a random 256 bit symmetric key (ss) and its encapsulation (c)
let c_ss = kyber.Encrypt768(pk);
let c = c_ss[0];
let ss1 = c_ss[1];
// To decapsulate and obtain the same symmetric key
let ss2 = kyber.Decrypt768(c,sk);
// Test function with KATs
kyber.Test768();
from crystals-kyber-javascript.
Related Issues (7)
- Undeclared variable prevents webpack bundling
- KeyGen512 is not defined on browser HOT 3
- Possible variable-time division when decapsulating
- How to change paramters HOT 1
- Encrypt function: convert kr to kr_str should be an Array of 64 bytes intead of 32 bytes HOT 1
- Using shared secret - aes - how? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crystals-kyber-javascript.