dfinity / agent-js

A collection of libraries and tools for building software around the Internet Computer, in JavaScript.

Home Page:https://agent-js.icp.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: import everything from tweetnacl?

peterpeterparker opened this issue · comments

Is your feature request related to a problem? Please describe.
While having a look at the size of agent-js I noticed tweetnacl which is currently imported with a wild card

import * as tweetnacl from 'tweetnacl';

Is there a chance that importing only the resources needed would spare few kb of code that is not needed here?

Additional context

Capture d’écran 2023-03-05 à 22 19 07

Btw. do agent-js still needs that lib or can use the platform API instead?

Same for import * as cbor from 'simple-cbor'; btw.

I can investigate the size impacts!

Unfortunately, web SubtleCrypto doesn't support ED25519, so we're dependent on a library for the time being

you folks should use noble-curves or noble-ed25519 instead, tweetnacl is not secure

Tweetnacl is removed in #784 in favor of noble-curves