react-native-quick-crypto 1.0.0-beta.12 → 1.0.0-beta.14

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 (115) hide show
  1. package/README.md +1 -1
  2. package/android/CMakeLists.txt +8 -2
  3. package/android/src/main/java/com/margelo/nitro/quickcrypto/QuickCryptoPackage.java +0 -2
  4. package/cpp/cipher/CCMCipher.cpp +199 -0
  5. package/cpp/cipher/CCMCipher.hpp +26 -0
  6. package/cpp/cipher/HybridCipher.cpp +324 -0
  7. package/cpp/cipher/HybridCipher.hpp +69 -0
  8. package/cpp/cipher/HybridCipherFactory.hpp +59 -0
  9. package/cpp/cipher/OCBCipher.cpp +55 -0
  10. package/cpp/cipher/OCBCipher.hpp +19 -0
  11. package/cpp/ed25519/HybridEdKeyPair.cpp +34 -91
  12. package/cpp/ed25519/HybridEdKeyPair.hpp +24 -54
  13. package/cpp/hash/HybridHash.cpp +30 -60
  14. package/cpp/hash/HybridHash.hpp +11 -27
  15. package/cpp/hmac/HybridHmac.cpp +95 -0
  16. package/cpp/hmac/HybridHmac.hpp +31 -0
  17. package/cpp/pbkdf2/HybridPbkdf2.cpp +34 -55
  18. package/cpp/pbkdf2/HybridPbkdf2.hpp +5 -16
  19. package/cpp/random/HybridRandom.cpp +5 -16
  20. package/cpp/random/HybridRandom.hpp +5 -6
  21. package/cpp/utils/Utils.hpp +1 -2
  22. package/lib/commonjs/cipher.js +157 -0
  23. package/lib/commonjs/cipher.js.map +1 -0
  24. package/lib/commonjs/hash.js +41 -18
  25. package/lib/commonjs/hash.js.map +1 -1
  26. package/lib/commonjs/hmac.js +109 -0
  27. package/lib/commonjs/hmac.js.map +1 -0
  28. package/lib/commonjs/index.js +31 -25
  29. package/lib/commonjs/index.js.map +1 -1
  30. package/lib/commonjs/pbkdf2.js.map +1 -1
  31. package/lib/commonjs/specs/cipher.nitro.js +6 -0
  32. package/lib/commonjs/specs/cipher.nitro.js.map +1 -0
  33. package/lib/commonjs/specs/hmac.nitro.js +6 -0
  34. package/lib/commonjs/specs/hmac.nitro.js.map +1 -0
  35. package/lib/commonjs/utils/cipher.js +64 -0
  36. package/lib/commonjs/utils/cipher.js.map +1 -0
  37. package/lib/commonjs/utils/types.js +3 -1
  38. package/lib/commonjs/utils/types.js.map +1 -1
  39. package/lib/module/cipher.js +150 -0
  40. package/lib/module/cipher.js.map +1 -0
  41. package/lib/module/hash.js +41 -18
  42. package/lib/module/hash.js.map +1 -1
  43. package/lib/module/hmac.js +104 -0
  44. package/lib/module/hmac.js.map +1 -0
  45. package/lib/module/index.js +9 -23
  46. package/lib/module/index.js.map +1 -1
  47. package/lib/module/pbkdf2.js.map +1 -1
  48. package/lib/module/specs/cipher.nitro.js +4 -0
  49. package/lib/module/specs/cipher.nitro.js.map +1 -0
  50. package/lib/module/specs/hmac.nitro.js +4 -0
  51. package/lib/module/specs/hmac.nitro.js.map +1 -0
  52. package/lib/module/utils/cipher.js +56 -0
  53. package/lib/module/utils/cipher.js.map +1 -0
  54. package/lib/module/utils/types.js +4 -0
  55. package/lib/module/utils/types.js.map +1 -1
  56. package/lib/tsconfig.tsbuildinfo +1 -1
  57. package/lib/typescript/cipher.d.ts +52 -0
  58. package/lib/typescript/cipher.d.ts.map +1 -0
  59. package/lib/typescript/hash.d.ts +23 -1
  60. package/lib/typescript/hash.d.ts.map +1 -1
  61. package/lib/typescript/hmac.d.ts +66 -0
  62. package/lib/typescript/hmac.d.ts.map +1 -0
  63. package/lib/typescript/index.d.ts +17 -12
  64. package/lib/typescript/index.d.ts.map +1 -1
  65. package/lib/typescript/keys/utils.d.ts.map +1 -1
  66. package/lib/typescript/pbkdf2.d.ts +1 -1
  67. package/lib/typescript/pbkdf2.d.ts.map +1 -1
  68. package/lib/typescript/specs/cipher.nitro.d.ts +29 -0
  69. package/lib/typescript/specs/cipher.nitro.d.ts.map +1 -0
  70. package/lib/typescript/specs/hmac.nitro.d.ts +10 -0
  71. package/lib/typescript/specs/hmac.nitro.d.ts.map +1 -0
  72. package/lib/typescript/utils/cipher.d.ts +7 -0
  73. package/lib/typescript/utils/cipher.d.ts.map +1 -0
  74. package/lib/typescript/utils/conversion.d.ts.map +1 -1
  75. package/lib/typescript/utils/types.d.ts +6 -1
  76. package/lib/typescript/utils/types.d.ts.map +1 -1
  77. package/nitrogen/generated/.gitattributes +1 -0
  78. package/nitrogen/generated/android/QuickCrypto+autolinking.cmake +19 -0
  79. package/nitrogen/generated/android/QuickCryptoOnLoad.cpp +35 -5
  80. package/nitrogen/generated/android/kotlin/com/margelo/nitro/crypto/QuickCryptoOnLoad.kt +35 -0
  81. package/nitrogen/generated/ios/QuickCrypto+autolinking.rb +2 -0
  82. package/nitrogen/generated/ios/QuickCrypto-Swift-Cxx-Umbrella.hpp +0 -1
  83. package/nitrogen/generated/ios/QuickCryptoAutolinking.mm +35 -5
  84. package/nitrogen/generated/shared/c++/CFRGKeyPairType.hpp +1 -1
  85. package/nitrogen/generated/shared/c++/CipherArgs.hpp +88 -0
  86. package/nitrogen/generated/shared/c++/HybridCipherFactorySpec.cpp +21 -0
  87. package/nitrogen/generated/shared/c++/HybridCipherFactorySpec.hpp +67 -0
  88. package/nitrogen/generated/shared/c++/HybridCipherSpec.cpp +28 -0
  89. package/nitrogen/generated/shared/c++/HybridCipherSpec.hpp +76 -0
  90. package/nitrogen/generated/shared/c++/HybridEdKeyPairSpec.hpp +1 -1
  91. package/nitrogen/generated/shared/c++/HybridHashSpec.hpp +1 -1
  92. package/nitrogen/generated/shared/c++/HybridHmacSpec.cpp +23 -0
  93. package/nitrogen/generated/shared/c++/HybridHmacSpec.hpp +66 -0
  94. package/nitrogen/generated/shared/c++/HybridKeyObjectHandleSpec.hpp +1 -1
  95. package/nitrogen/generated/shared/c++/HybridPbkdf2Spec.hpp +1 -1
  96. package/nitrogen/generated/shared/c++/HybridRandomSpec.hpp +1 -1
  97. package/nitrogen/generated/shared/c++/JWK.hpp +2 -1
  98. package/nitrogen/generated/shared/c++/JWKkty.hpp +1 -1
  99. package/nitrogen/generated/shared/c++/JWKuse.hpp +1 -1
  100. package/nitrogen/generated/shared/c++/KFormatType.hpp +1 -1
  101. package/nitrogen/generated/shared/c++/KeyDetail.hpp +2 -1
  102. package/nitrogen/generated/shared/c++/KeyEncoding.hpp +1 -1
  103. package/nitrogen/generated/shared/c++/KeyType.hpp +1 -1
  104. package/nitrogen/generated/shared/c++/KeyUsage.hpp +1 -1
  105. package/nitrogen/generated/shared/c++/NamedCurve.hpp +1 -1
  106. package/package.json +3 -13
  107. package/src/cipher.ts +303 -0
  108. package/src/hash.ts +51 -15
  109. package/src/hmac.ts +135 -0
  110. package/src/index.ts +9 -23
  111. package/src/pbkdf2.ts +1 -1
  112. package/src/specs/cipher.nitro.ts +25 -0
  113. package/src/specs/hmac.nitro.ts +7 -0
  114. package/src/utils/cipher.ts +60 -0
  115. package/src/utils/types.ts +27 -0
@@ -282,3 +282,30 @@ export type Encoding =
282
282
  | CharacterEncoding
283
283
  | LegacyCharacterEncoding
284
284
  | 'buffer';
285
+
286
+ // These are for shortcomings in @types/node
287
+ // Here we use "*Type" instead of "*Types" like node does.
288
+ // export type CipherCBCType = 'aes-128-cbc' | 'aes-192-cbc' | 'aes-256-cbc';
289
+ export type CipherCFBType =
290
+ | 'aes-128-cfb'
291
+ | 'aes-192-cfb'
292
+ | 'aes-256-cfb'
293
+ | 'aes-128-cfb1'
294
+ | 'aes-192-cfb1'
295
+ | 'aes-256-cfb1'
296
+ | 'aes-128-cfb8'
297
+ | 'aes-192-cfb8'
298
+ | 'aes-256-cfb8';
299
+ export type CipherCTRType = 'aes-128-ctr' | 'aes-192-ctr' | 'aes-256-ctr';
300
+ export type CipherDESType =
301
+ | 'des'
302
+ | 'des3'
303
+ | 'des-cbc'
304
+ | 'des-ecb'
305
+ | 'des-ede'
306
+ | 'des-ede-cbc'
307
+ | 'des-ede3'
308
+ | 'des-ede3-cbc';
309
+ export type CipherECBType = 'aes-128-ecb' | 'aes-192-ecb' | 'aes-256-ecb';
310
+ export type CipherGCMType = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';
311
+ export type CipherOFBType = 'aes-128-ofb' | 'aes-192-ofb' | 'aes-256-ofb';