Comments (6)
Thanks for finding those bugs!
What you suggest would be useful, but while we would certainly welcome a node.js package, we could not commit to maintaining it.
Mike
from core.
You are welcome and thank you for your fast response!
It seems to me that there isn't much to do to support Node.js. I am not sure how it will be for npm platform (I didn't it before), but for this repository to support Node.js there is not much to do (as I know in this moment of writing this). I did the following:
- added export of the classes (prototypes) to every file e.g. for fp.js
if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
module.exports = {
FP: FP
};
}
-
added a index.js with the following code
module.exports.CTX = require('./amcl-js/ctx');
-
added package.json(for simplicity with the following stub)
"name": "<name>",
"version": "3.X.X",
"description": "<description>",
"main": "<path>/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "<Author Name>",
"license": "<some licence>"
}
Afterm them I used in my React project `npm install ' and was able to use the node package with your Javascript code with
const CTX = require("pesto-client").CTX;
let ctxBls12461 = new CTX('BLS12461');
As of my understanding and testing it should be possible with these changes that the code is usable in Javascript as before and it is possible in another Javascript files as functions from a library in plain Javascript. Additionally a person is able to build a npm package locally and can use it in Node.js or React projects (I don't know much about AngularJS, but maybe also there - I didn't tested it yet).
from core.
If you put together a Pull Request, and if it doesn't break anything, we will approve it. Unfortunately we don't have a JS expert on the team at the moment, so I cannot be of much help.
Mike
from core.
Ok. Let me do some tests and if everything works fine I can do a Pull Request and you or some of the contributors can double check it, such that there exist no side effects, which maybe I am not aware of. Thank you! I will let you know, when I am done with the tests.
Pascal
from core.
OK that's fine
from core.
Pull Request + Merge done.
from core.
Related Issues (20)
- Rust: incorrect normalization for 1*1 in FP12. HOT 2
- JS library doesn't compile HOT 1
- BLS: bug in Rust implementation? HOT 3
- ECP::muln() bug? HOT 2
- Bug with BIG.mod in Java? HOT 2
- ECP2 multiply by FP in golang? HOT 15
- G2mul for ECP? (Golang) HOT 3
- golang: Signature Recover function using FP, ECP
- core/python could be structured more like a Python module HOT 2
- Javascript ecp2 toBytes functions gives not the same bytes as in the Java implementation HOT 5
- FP256BN Plus and math.MaxInt64
- feature request: addition of AES-CTR (and optionally, SIV-AES) HOT 2
- Reporting security issues HOT 2
- BLS12-381 Signature Aggregation HOT 3
- Is `ECP::mapit` a good random oracle? HOT 4
- secp256r1 HOT 2
- Support go modules HOT 3
- Pairing Example with JS
- select indepentent generator with node js HOT 1
- Attack against M-PIN HOT 4
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 core.