Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'elGamal' of undefined #423

Open
medi11 opened this issue Feb 6, 2021 · 1 comment
Open

TypeError: Cannot read property 'elGamal' of undefined #423

medi11 opened this issue Feb 6, 2021 · 1 comment

Comments

@medi11
Copy link

medi11 commented Feb 6, 2021

Here is a code snippet. whenever I execute it I get the above error
`const sjcl = require("sjcl");
var gkey1 = sjcl.ecc.elGamal.generateKeys(384, 10);
var alicekeys = gkey1.pub.kem(10);

var gkey2 = sjcl.ecc.elGamal.generateKeys(384, 10);
var bobkeys = gkey2.pub.kem(10);

var aliceshared = alicekeys.key;
var bobshared = gkey2.sec.unkem(alicekeys.tag);
`

@BruceMacD
Copy link

In order to enable some sjlc modules it is required to re-compile the library yourself.

$ git clone https://github.com/bitwiseshiftleft/sjcl.git
$ cd sjcl
$ ./configure # Requests for extensions go here, e.g. --with-ecc --with-srp
$ make sjcl.js
$ make test  # If any of the tests fail, beware.

Then reference your build of sjlc in your code:

import sjcl from <path_to_local_build>/sjcl";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants