elliptic icon indicating copy to clipboard operation
elliptic copied to clipboard

DeprecationWarning on Buffer

Open exoego opened this issue 5 years ago • 3 comments

I see the below warning on Node.js 10.x and 12.x [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

new Buffer(size) had been deprecated in Node.js 6.0.0 back in 2016-04-26. https://nodejs.org/api/buffer.html#buffer_new_buffer_size

I suspect these lines https://github.com/indutny/elliptic/blob/71e4e8e2f5b8f0bdbfbe106c72cc9fbc746d3d60/dist/elliptic.js#L4367 https://github.com/indutny/elliptic/blob/71e4e8e2f5b8f0bdbfbe106c72cc9fbc746d3d60/dist/elliptic.js#L4382

exoego avatar Sep 11 '19 21:09 exoego

Ah, sorry. These lines come from bn.js. I will transfer this issue there. https://github.com/indutny/bn.js/blob/79dccc4d3274ffae17cfb54ce08703a98b1d4fe0/lib/bn.js

exoego avatar Sep 11 '19 21:09 exoego

Ah, bn.js already addressed deprecation in latest version. I think elliptic should update bn.js dependeny. I will open a PR.

exoego avatar Sep 11 '19 21:09 exoego

Duplicate of #191 in some way.

fanatid avatar Sep 12 '19 05:09 fanatid