@libp2p/crypto 1.0.17 → 2.0.0-e66f4891

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +3 -3
  2. package/dist/index.min.js +12 -12
  3. package/dist/src/aes/cipher-mode.js +1 -1
  4. package/dist/src/aes/cipher-mode.js.map +1 -1
  5. package/dist/src/aes/ciphers-browser.d.ts.map +1 -1
  6. package/dist/src/aes/ciphers-browser.js.map +1 -1
  7. package/dist/src/ciphers/interface.d.ts.map +1 -1
  8. package/dist/src/hmac/lengths.d.ts.map +1 -1
  9. package/dist/src/hmac/lengths.js.map +1 -1
  10. package/dist/src/keys/ecdh-browser.js +1 -1
  11. package/dist/src/keys/ecdh-browser.js.map +1 -1
  12. package/dist/src/keys/ecdh.js +1 -1
  13. package/dist/src/keys/ecdh.js.map +1 -1
  14. package/dist/src/keys/ed25519-class.js +1 -1
  15. package/dist/src/keys/ed25519-class.js.map +1 -1
  16. package/dist/src/keys/index.d.ts +1 -1
  17. package/dist/src/keys/index.js +1 -1
  18. package/dist/src/keys/index.js.map +1 -1
  19. package/dist/src/keys/interface.d.ts.map +1 -1
  20. package/dist/src/keys/key-stretcher.js +1 -1
  21. package/dist/src/keys/key-stretcher.js.map +1 -1
  22. package/dist/src/keys/rsa-browser.js +1 -1
  23. package/dist/src/keys/rsa-browser.js.map +1 -1
  24. package/dist/src/keys/rsa-class.d.ts.map +1 -1
  25. package/dist/src/keys/rsa-class.js +1 -1
  26. package/dist/src/keys/rsa-class.js.map +1 -1
  27. package/dist/src/keys/rsa-utils.js +1 -1
  28. package/dist/src/keys/rsa-utils.js.map +1 -1
  29. package/dist/src/keys/rsa.js +1 -1
  30. package/dist/src/keys/rsa.js.map +1 -1
  31. package/dist/src/keys/secp256k1-class.js +1 -1
  32. package/dist/src/keys/secp256k1-class.js.map +1 -1
  33. package/dist/src/keys/secp256k1.js +1 -1
  34. package/dist/src/keys/secp256k1.js.map +1 -1
  35. package/dist/src/pbkdf2.js +1 -1
  36. package/dist/src/pbkdf2.js.map +1 -1
  37. package/dist/src/random-bytes.js +1 -1
  38. package/dist/src/random-bytes.js.map +1 -1
  39. package/package.json +10 -106
  40. package/src/aes/cipher-mode.ts +1 -1
  41. package/src/aes/ciphers-browser.ts +0 -1
  42. package/src/ciphers/interface.ts +0 -1
  43. package/src/hmac/lengths.ts +0 -1
  44. package/src/keys/ecdh-browser.ts +1 -1
  45. package/src/keys/ecdh.ts +1 -1
  46. package/src/keys/ed25519-class.ts +1 -1
  47. package/src/keys/index.ts +2 -2
  48. package/src/keys/interface.ts +1 -2
  49. package/src/keys/key-stretcher.ts +1 -1
  50. package/src/keys/rsa-browser.ts +1 -1
  51. package/src/keys/rsa-class.ts +1 -2
  52. package/src/keys/rsa-utils.ts +1 -1
  53. package/src/keys/rsa.ts +1 -1
  54. package/src/keys/secp256k1-class.ts +1 -1
  55. package/src/keys/secp256k1.ts +1 -1
  56. package/src/pbkdf2.ts +1 -1
  57. package/src/random-bytes.ts +1 -1
  58. package/dist/typedoc-urls.json +0 -41
package/src/keys/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'node-forge/lib/asn1.js'
2
2
  import 'node-forge/lib/pbe.js'
3
- import { CodeError } from '@libp2p/interfaces/errors'
3
+ import { CodeError } from '@libp2p/interface/errors'
4
4
  // @ts-expect-error types are missing
5
5
  import forge from 'node-forge/lib/forge.js'
6
6
  import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
@@ -11,7 +11,7 @@ import { keyStretcher } from './key-stretcher.js'
11
11
  import * as keysPBM from './keys.js'
12
12
  import * as RSA from './rsa-class.js'
13
13
  import * as Secp256k1 from './secp256k1-class.js'
14
- import type { PrivateKey, PublicKey } from '@libp2p/interface-keys'
14
+ import type { PrivateKey, PublicKey } from '@libp2p/interface/keys'
15
15
 
16
16
  export { keyStretcher }
17
17
  export { generateEphemeralKeyPair }
@@ -1,4 +1,3 @@
1
-
2
1
  export interface JWKKeyPair {
3
2
  privateKey: JsonWebKey
4
3
  publicKey: JsonWebKey
@@ -21,7 +20,7 @@ export interface ECDHKey {
21
20
 
22
21
  export interface JWKEncodedPublicKey { kty: string, crv: 'P-256' | 'P-384' | 'P-521', x: string, y: string, ext: boolean }
23
22
 
24
- export interface JWKEncodedPrivateKey extends JWKEncodedPublicKey { d: string}
23
+ export interface JWKEncodedPrivateKey extends JWKEncodedPublicKey { d: string }
25
24
 
26
25
  export interface EnhancedKey {
27
26
  iv: Uint8Array
@@ -1,4 +1,4 @@
1
- import { CodeError } from '@libp2p/interfaces/errors'
1
+ import { CodeError } from '@libp2p/interface/errors'
2
2
  import { concat as uint8ArrayConcat } from 'uint8arrays/concat'
3
3
  import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
4
4
  import * as hmac from '../hmac/index.js'
@@ -1,4 +1,4 @@
1
- import { CodeError } from '@libp2p/interfaces/errors'
1
+ import { CodeError } from '@libp2p/interface/errors'
2
2
  import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
3
3
  import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
4
4
  import randomBytes from '../random-bytes.js'
@@ -1,5 +1,4 @@
1
-
2
- import { CodeError } from '@libp2p/interfaces/errors'
1
+ import { CodeError } from '@libp2p/interface/errors'
3
2
  import { sha256 } from 'multiformats/hashes/sha2'
4
3
  // @ts-expect-error types are missing
5
4
  import forge from 'node-forge/lib/forge.js'
@@ -1,6 +1,6 @@
1
1
  import 'node-forge/lib/asn1.js'
2
2
  import 'node-forge/lib/rsa.js'
3
- import { CodeError } from '@libp2p/interfaces/errors'
3
+ import { CodeError } from '@libp2p/interface/errors'
4
4
  // @ts-expect-error types are missing
5
5
  import forge from 'node-forge/lib/forge.js'
6
6
  import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
package/src/keys/rsa.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import crypto from 'crypto'
2
2
  import { promisify } from 'util'
3
- import { CodeError } from '@libp2p/interfaces/errors'
3
+ import { CodeError } from '@libp2p/interface/errors'
4
4
  import randomBytes from '../random-bytes.js'
5
5
  import * as utils from './rsa-utils.js'
6
6
  import type { JWKKeyPair } from './interface.js'
@@ -1,4 +1,4 @@
1
- import { CodeError } from '@libp2p/interfaces/errors'
1
+ import { CodeError } from '@libp2p/interface/errors'
2
2
  import { sha256 } from 'multiformats/hashes/sha2'
3
3
  import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
4
4
  import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
@@ -1,4 +1,4 @@
1
- import { CodeError } from '@libp2p/interfaces/errors'
1
+ import { CodeError } from '@libp2p/interface/errors'
2
2
  import * as secp from '@noble/secp256k1'
3
3
  import { sha256 } from 'multiformats/hashes/sha2'
4
4
 
package/src/pbkdf2.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CodeError } from '@libp2p/interfaces/errors'
1
+ import { CodeError } from '@libp2p/interface/errors'
2
2
  // @ts-expect-error types are missing
3
3
  import forgePbkdf2 from 'node-forge/lib/pbkdf2.js'
4
4
  // @ts-expect-error types are missing
@@ -1,4 +1,4 @@
1
- import { CodeError } from '@libp2p/interfaces/errors'
1
+ import { CodeError } from '@libp2p/interface/errors'
2
2
  import { utils } from '@noble/secp256k1'
3
3
 
4
4
  export default function randomBytes (length: number): Uint8Array {
@@ -1,41 +0,0 @@
1
- {
2
- "AESCipher": "https://libp2p.github.io/js-libp2p-crypto/interfaces/aes.AESCipher.html",
3
- "create": "https://libp2p.github.io/js-libp2p-crypto/functions/aes.create.html",
4
- "HMAC": "https://libp2p.github.io/js-libp2p-crypto/interfaces/hmac.HMAC.html",
5
- "pbkdf2": "https://libp2p.github.io/js-libp2p-crypto/functions/index.pbkdf2.html",
6
- "randomBytes": "https://libp2p.github.io/js-libp2p-crypto/functions/index.randomBytes.html",
7
- "Ed25519PrivateKey": "https://libp2p.github.io/js-libp2p-crypto/classes/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_ed25519_class_.Ed25519PrivateKey.html",
8
- "Ed25519PublicKey": "https://libp2p.github.io/js-libp2p-crypto/classes/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_ed25519_class_.Ed25519PublicKey.html",
9
- "generateKeyPair": "https://libp2p.github.io/js-libp2p-crypto/functions/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_ed25519_class_.generateKeyPair.html",
10
- "generateKeyPairFromSeed": "https://libp2p.github.io/js-libp2p-crypto/functions/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_ed25519_class_.generateKeyPairFromSeed.html",
11
- "unmarshalEd25519PrivateKey": "https://libp2p.github.io/js-libp2p-crypto/functions/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_ed25519_class_.unmarshalEd25519PrivateKey.html",
12
- "unmarshalEd25519PublicKey": "https://libp2p.github.io/js-libp2p-crypto/functions/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_ed25519_class_.unmarshalEd25519PublicKey.html",
13
- "RsaPrivateKey": "https://libp2p.github.io/js-libp2p-crypto/classes/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_rsa_class_.RsaPrivateKey.html",
14
- "RsaPublicKey": "https://libp2p.github.io/js-libp2p-crypto/classes/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_rsa_class_.RsaPublicKey.html",
15
- "fromJwk": "https://libp2p.github.io/js-libp2p-crypto/functions/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_rsa_class_.fromJwk.html",
16
- "unmarshalRsaPrivateKey": "https://libp2p.github.io/js-libp2p-crypto/functions/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_rsa_class_.unmarshalRsaPrivateKey.html",
17
- "unmarshalRsaPublicKey": "https://libp2p.github.io/js-libp2p-crypto/functions/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_rsa_class_.unmarshalRsaPublicKey.html",
18
- "Secp256k1PrivateKey": "https://libp2p.github.io/js-libp2p-crypto/classes/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_secp256k1_class_.Secp256k1PrivateKey.html",
19
- "Secp256k1PublicKey": "https://libp2p.github.io/js-libp2p-crypto/classes/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_secp256k1_class_.Secp256k1PublicKey.html",
20
- "unmarshalSecp256k1PrivateKey": "https://libp2p.github.io/js-libp2p-crypto/functions/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_secp256k1_class_.unmarshalSecp256k1PrivateKey.html",
21
- "unmarshalSecp256k1PublicKey": "https://libp2p.github.io/js-libp2p-crypto/functions/keys._internal_.__home_runner_work_js_libp2p_crypto_js_libp2p_crypto_src_keys_secp256k1_class_.unmarshalSecp256k1PublicKey.html",
22
- "ECDHKey": "https://libp2p.github.io/js-libp2p-crypto/interfaces/keys._internal_.ECDHKey.html",
23
- "ECDHKeyPair": "https://libp2p.github.io/js-libp2p-crypto/interfaces/keys._internal_.ECDHKeyPair.html",
24
- "EnhancedKey": "https://libp2p.github.io/js-libp2p-crypto/interfaces/keys._internal_.EnhancedKey.html",
25
- "EnhancedKeyPair": "https://libp2p.github.io/js-libp2p-crypto/interfaces/keys._internal_.EnhancedKeyPair.html",
26
- "codec": "https://libp2p.github.io/js-libp2p-crypto/functions/keys.keysPBM.KeyType.codec.html",
27
- "decode": "https://libp2p.github.io/js-libp2p-crypto/functions/keys.keysPBM.PrivateKey.decode.html",
28
- "encode": "https://libp2p.github.io/js-libp2p-crypto/functions/keys.keysPBM.PrivateKey.encode.html",
29
- "KeyType": "https://libp2p.github.io/js-libp2p-crypto/enums/keys.keysPBM.KeyType-1.html",
30
- "PrivateKey": "https://libp2p.github.io/js-libp2p-crypto/interfaces/keys.keysPBM.PrivateKey-1.html",
31
- "PublicKey": "https://libp2p.github.io/js-libp2p-crypto/interfaces/keys.keysPBM.PublicKey-1.html",
32
- "KeyTypes": "https://libp2p.github.io/js-libp2p-crypto/types/keys.KeyTypes.html",
33
- "supportedKeys": "https://libp2p.github.io/js-libp2p-crypto/variables/keys.supportedKeys.html",
34
- "generateEphemeralKeyPair": "https://libp2p.github.io/js-libp2p-crypto/functions/keys.generateEphemeralKeyPair.html",
35
- "importKey": "https://libp2p.github.io/js-libp2p-crypto/functions/keys.importKey.html",
36
- "keyStretcher": "https://libp2p.github.io/js-libp2p-crypto/functions/keys.keyStretcher.html",
37
- "marshalPrivateKey": "https://libp2p.github.io/js-libp2p-crypto/functions/keys.marshalPrivateKey.html",
38
- "marshalPublicKey": "https://libp2p.github.io/js-libp2p-crypto/functions/keys.marshalPublicKey.html",
39
- "unmarshalPrivateKey": "https://libp2p.github.io/js-libp2p-crypto/functions/keys.unmarshalPrivateKey.html",
40
- "unmarshalPublicKey": "https://libp2p.github.io/js-libp2p-crypto/functions/keys.unmarshalPublicKey.html"
41
- }