* Fix Ed25519 PeerID generation
This commit pushes further fixes to the generation of Ed25519 peer IDs,
building upon the discussion in ipfs/js-ipfs#3591 and the subsequent
pull request libp2p/js-libp2p-crypto#185.
The purpose of this new pull request is to harmonize the encoding of
PeerIDs for Ed25519 keys such that the same new format is used
everywhere: peer IDs when assigned upon key generation, peer IDs when
shown via key listing, as well as the peer IDs displayed as IPNS names
when the key is used as the basis for an IPNS record.
Concretely, this changes the peer ID representation of Ed25519 keys from
the `Qm...` format to the newer `1...` format.
The accompanying test has been modified accordingly.
* Satisfy linter
* fix: replace node buffers with uint8arrays
All usage of node buffers have been replaced with uint8arrays.
BREAKING CHANGES:
- Where node Buffers were returned, now Uint8Arrays are
* chore: remove commented code
* feat: add exporting/importing of ed25519 keys in libp2p-key format
* feat: add libp2p-key export/import support for rsa and secp keys
* chore: dep bumps
* chore: update aegir
* refactor: import and export base64 strings
* refactor: simplify api for now
* chore: fix lint
* refactor: remove extraneous param
* refactor: clean up
* fix: review patches
* fix: add buffer, cleanup, reduce size
- add buffer related to https://github.com/ipfs/js-ipfs/issues/2924
- remove unnecessary eslint ignore
- remove tweelnacl and use node-forge
- remove browserify-aes and use node-forge
- use multibase to encode b58
- require only sha256 from multihashing
- reduce bundle size
after all the deps here https://github.com/ipfs/js-ipfs/issues/2924 are merged libp2p-crypto will be able to be bundle with `node: false` 🎉
* fix: reduce bundle size
* fix: use new secp
* fix: bundle size
* chore: update secp
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
* fix: add buffer and update deps
update secp256k1 dep and fix code
use multibase to encode b58
avoid un-necessary circular dependency no libp2p-crypto
use only sha256 from multihashing-async
* Update src/crypto.js
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
* chore: remove commitlint from CI
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
* perf: remove asn1.js from rsa
* fix: tweaks
* fix: it works, but I do not know 100% why
* chore: remove asn1.js
* fix: ensure jwk params encoded as uint
* fix: util tests
* fix: zero pad base64urlToBuffer
* fix: more zero pad
* test: add round trip test
* test: base64url to Buffer with padding