48 Commits

Author SHA1 Message Date
Hugo Dias
8d8294dc3f fix: clean up, bundle size reduction
BREAKING CHANGE: getRandomValues method exported from src/keys/rsa-browser.js and src/keys/rsa.js signature has changed from accepting an array to a number for random byte length
2019-01-08 21:29:42 +01:00
Jacob Heun
c54ea206f0 feat: nextTick instead of setImmediate, and fix sync in async (#136)
* fix: avoid sync callback in async function

* chore: fix linting

* chore: remove non jenkins ci

* refactor: use nextTick over setImmediate

* refactor: async/nextTick for better browser support
2019-01-03 16:13:07 +00:00
Jacob Heun
9e5778694c fix: dont setimmediate when its not needed 2018-11-05 19:26:45 +01:00
Maciej Krüger
f4c00893ad test: add test for different rsa crypto libs 2018-09-17 15:32:13 -07:00
Maciej Krüger
b05e77f375 feat: use ursa-optional for lightning fast key generation
The difference between ursa and ursa-optional is that ursa-optional does not cause any problems if it fails to compile
2018-09-17 15:32:13 -07:00
Richard Schneider
cdcca5f828 feat: improve perf (#117) 2018-01-27 10:54:04 -08:00
Richard Schneider
b3421284f9 feat: key exchange with jsrsasign (#115)
* feat: export/import password protected RSA key

* docs: crypto.key.import

* test: import with wrong password

* fix: lint

* test: importing openssl keys

* just to trigger circle with new ubuntu

* feat: get the RSA key id

* feat: get the ED 25519 key id

* feat: pbkdf2

* fix(pbkdf2): base64 has more chars to guess than hex

* chore: update deps
2017-12-20 08:11:47 +00:00
Maciej Krüger
7608fdd858 fix: catch error when unmarshaling instead of crashing (#113)
* test: Add failing tests

* fix: Fix some failing tests

* fix: various fixes on garbage error handling and respective tests

* tests: increased timeout for test timing out in CI

* tests: increasing test timeout to please the CI gods

* tests: increasing test timeout to please the CI gods

* fix: for when unMarshallPrivateKey is called with null or undefined key
2017-12-01 08:36:29 +00:00
Friedel Ziegelmayer
3a91ae2ed8 feat: switch protocol-buffers to protons (#110)
Ref https://github.com/ipfs/js-ipfs/issues/991
2017-09-07 10:37:56 +01:00
David Dias
957fdd37e9 fix: use regular protocol-buffers until protobufjs is fixed (#109) 2017-09-06 08:29:45 +01:00
Friedel Ziegelmayer
83257bc4bd feat(deps): upgrade to aegir@12 and browserify-aes@1.0.8 2017-09-05 15:28:43 +02:00
Friedel Ziegelmayer
dc2793f138 fix: switch to protobufjs (#107)
rm unsafe-eval
2017-09-05 11:05:47 +01:00
Friedel Ziegelmayer
f20267b962 feat: skip nextTick in nodeify (#103) 2017-08-17 06:38:26 +02:00
David Dias
bc554d1407 fix: circular circular dep -> DI 2017-07-22 13:25:15 -07:00
David Dias
2f8e234044 refactor: the whole thing (#102) 2017-07-22 10:57:27 -07:00
Jack Kleeman
be64372a5e fix(ecdh): allow base64 to be left-0-padded, needed for JWK format
Fixes #97
2017-04-11 11:14:00 +02:00
Jack Kleeman
e5b7c1f622 feat(keys): implement generateKeyPairFromSeed for ed25519
Implement generateKeyPairFromSeed for ed25519 - this will produce the same keypair for the same seed (or first 32 bytes of reader) as given to GenerateKeyPairWithReader in go-libp2p.
2017-03-03 21:38:51 +01:00
David Dias
c73adb00cc fix: add libp2p-crypto-secp256k1 2017-02-10 18:53:36 -08:00
Friedel Ziegelmayer
19c6ce7c06 Merge pull request #65 from dryajov/master
feat: change window to self for webworker support
2017-02-07 20:45:01 +01:00
Friedel Ziegelmayer
c91d9b61c8 feat: expose protobuf
this allows other modules to reuse the protobuf definition
2017-02-07 17:51:43 +01:00
Yusef Napora
76eeb5aa18 feat: add support for secp256k1 keys through the libp2p-crypto-secp256k1 module 2017-02-04 10:23:38 +01:00
dryajov
843b5e33d6 WIP: use self instead of window for WebWorker compatibility 2017-01-31 02:09:46 -08:00
dryajov
d59c6af7c0 Merge branch 'master' of https://github.com/libp2p/js-libp2p-crypto 2017-01-23 18:39:51 -08:00
dryajov
5c61c89391 fixing lint issues with self 2017-01-20 16:20:23 -08:00
Friedel Ziegelmayer
1a2d468369 fix: consistent buffer usage (#56)
* fix: consistent buffer usage

Closes #49

* more fixes for node 4
2017-01-16 05:17:50 +01:00
Tom Swindell
98bc0bbc5f Support for WebWorker.
Signed-off-by: Tom Swindell <t.swindell@rubyx.co.uk>
2017-01-14 12:45:52 +00:00
Yusef Napora
c45bdf602e feat(keys): add Ed25519 support for signing & verification
Closes #43
2016-12-23 14:52:40 +01:00
Friedel Ziegelmayer
2842df7944 fix: use toArrayLike instead of toBuffer for browserify 2016-12-13 12:52:43 +01:00
nikuda
933119445f fix(utils): make util.toBase64 browserify compatible
`bn.toArrayLike` is used instead of `bn.toBuffer`, to ensure compatibility with browserify.
2016-12-03 09:32:07 +01:00
David Dias
98b37d49c4 feat: add randomBytes function (#45)
* feat: add randomBytes function

* fix: apply CR
2016-12-01 11:42:19 +00:00
Friedel Ziegelmayer
148d16ab25 feat(rsa): add fallback pure js fallback for webcrypto-ossl 2016-11-29 17:54:41 +01:00
Friedel Ziegelmayer
6d15450438 feat(ecdh): use node core instead of webcrypto-ossl 2016-11-29 16:36:56 +01:00
Friedel Ziegelmayer
9994023490 fix(aes): replace subtle.crypto with browserify-aes
Due to the design of `AES-CTR` in the webcrypto spec, there
is no streaming mode provided. This results in the counter
not being reused between subsequent calls to `encrypt` or
`decrypt`. As both the node.js and the go implementation rely
on this webcrypto had to be replaced.
2016-11-10 17:19:45 +01:00
nikuda
b088bab80f feat: replace lib multihashing with multihashing-async 2016-11-01 12:48:36 +01:00
Friedel Ziegelmayer
6ebc408f73 docs: update the docs 2016-11-01 12:47:58 +01:00
Friedel Ziegelmayer
08c5df5e79 feat: use webcrypto in favor of node-forge
BREAKING CHANGE: generateKeyPair is now async
2016-11-01 12:47:58 +01:00
David Dias
51cff12c3f big-endian 2016-09-05 14:26:28 -04:00
dignifiedquire
1270f3e37e refactor: make rsa key generation sync 2016-05-24 12:36:34 +02:00
Friedel Ziegelmayer
18810aca86 fix: some issues found when using in libp2p-secio 2016-05-23 12:31:45 +02:00
Friedel Ziegelmayer
87a30e2e9b fix: workaround missing sha512 support in forge.hmac 2016-05-20 16:27:11 +02:00
Friedel Ziegelmayer
893423aa93 go interop for keyStretcher 2016-05-20 15:55:19 +02:00
Friedel Ziegelmayer
7cb9d2820b go interop test for ephemeral keys 2016-05-20 15:13:56 +02:00
Friedel Ziegelmayer
d4c1672e06 rsa key compat with go 2016-05-20 14:41:25 +02:00
Friedel Ziegelmayer
fe202607eb first pass at stretchKey 2016-05-20 12:50:16 +02:00
Friedel Ziegelmayer
d415fa8007 feat: implement generateEphemeralKeyPair 2016-05-19 22:33:09 +02:00
dignifiedquire
ca0b5305a2 feat: add marshal and unmarshl methods 2016-05-19 21:45:43 +02:00
dignifiedquire
f3a22ea5ff finish rsa implementation 2016-05-19 20:18:31 +02:00
dignifiedquire
37edb7d0e4 inital commit 2016-05-19 18:47:48 +02:00