@aws-amplify/react-native 1.0.1-console-preview.deaebd5.0

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 (59) hide show
  1. package/AmplifyRTNCore.podspec +35 -0
  2. package/LICENSE +201 -0
  3. package/android/build.gradle +85 -0
  4. package/android/gradle.properties +4 -0
  5. package/android/src/main/AndroidManifest.xml +4 -0
  6. package/android/src/main/kotlin/com/amazonaws/amplify/rtncore/AmplifyRTNCoreModule.kt +29 -0
  7. package/android/src/main/kotlin/com/amazonaws/amplify/rtncore/AmplifyRTNCorePackage.kt +17 -0
  8. package/android/src/main/kotlin/com/amazonaws/amplify/rtncore/BigInteger.kt +65 -0
  9. package/ios/AmplifyRTNCore-Bridging-Header.h +5 -0
  10. package/ios/AmplifyRTNCore.mm +21 -0
  11. package/ios/AmplifyRTNCore.swift +29 -0
  12. package/ios/AmplifyRTNCore.xcodeproj/project.pbxproj +283 -0
  13. package/ios/AmplifyRTNCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  14. package/ios/BigInteger.swift +78 -0
  15. package/ios/JKBigInteger/JKBigDecimal.h +40 -0
  16. package/ios/JKBigInteger/JKBigDecimal.m +224 -0
  17. package/ios/JKBigInteger/JKBigInteger.h +58 -0
  18. package/ios/JKBigInteger/JKBigInteger.m +419 -0
  19. package/ios/JKBigInteger/LICENSE.txt +18 -0
  20. package/ios/JKBigInteger/LibTomMath/tommath.c +6925 -0
  21. package/ios/JKBigInteger/LibTomMath/tommath.h +584 -0
  22. package/ios/JKBigInteger/LibTomMath/tommath_class.h +999 -0
  23. package/ios/JKBigInteger/LibTomMath/tommath_superclass.h +76 -0
  24. package/lib/apis/computeModPow.d.ts +2 -0
  25. package/lib/apis/computeModPow.js +9 -0
  26. package/lib/apis/computeModPow.js.map +1 -0
  27. package/lib/apis/computeS.d.ts +2 -0
  28. package/lib/apis/computeS.js +9 -0
  29. package/lib/apis/computeS.js.map +1 -0
  30. package/lib/index.d.ts +2 -0
  31. package/lib/index.js +10 -0
  32. package/lib/index.js.map +1 -0
  33. package/lib/nativeModule.d.ts +2 -0
  34. package/lib/nativeModule.js +18 -0
  35. package/lib/nativeModule.js.map +1 -0
  36. package/lib/types.d.ts +15 -0
  37. package/lib/types.js +5 -0
  38. package/lib/types.js.map +1 -0
  39. package/lib-esm/apis/computeModPow.d.ts +2 -0
  40. package/lib-esm/apis/computeModPow.js +5 -0
  41. package/lib-esm/apis/computeModPow.js.map +1 -0
  42. package/lib-esm/apis/computeS.d.ts +2 -0
  43. package/lib-esm/apis/computeS.js +5 -0
  44. package/lib-esm/apis/computeS.js.map +1 -0
  45. package/lib-esm/index.d.ts +2 -0
  46. package/lib-esm/index.js +5 -0
  47. package/lib-esm/index.js.map +1 -0
  48. package/lib-esm/nativeModule.d.ts +2 -0
  49. package/lib-esm/nativeModule.js +15 -0
  50. package/lib-esm/nativeModule.js.map +1 -0
  51. package/lib-esm/types.d.ts +15 -0
  52. package/lib-esm/types.js +4 -0
  53. package/lib-esm/types.js.map +1 -0
  54. package/package.json +57 -0
  55. package/src/apis/computeModPow.ts +8 -0
  56. package/src/apis/computeS.ts +8 -0
  57. package/src/index.ts +5 -0
  58. package/src/nativeModule.ts +22 -0
  59. package/src/types.ts +19 -0
@@ -0,0 +1,76 @@
1
+ /* super class file for PK algos */
2
+
3
+ /* default ... include all MPI */
4
+ #define LTM_ALL
5
+
6
+ /* RSA only (does not support DH/DSA/ECC) */
7
+ /* #define SC_RSA_1 */
8
+
9
+ /* For reference.... On an Athlon64 optimizing for speed...
10
+
11
+ LTM's mpi.o with all functions [striped] is 142KiB in size.
12
+
13
+ */
14
+
15
+ /* Works for RSA only, mpi.o is 68KiB */
16
+ #ifdef SC_RSA_1
17
+ #define BN_MP_SHRINK_C
18
+ #define BN_MP_LCM_C
19
+ #define BN_MP_PRIME_RANDOM_EX_C
20
+ #define BN_MP_INVMOD_C
21
+ #define BN_MP_GCD_C
22
+ #define BN_MP_MOD_C
23
+ #define BN_MP_MULMOD_C
24
+ #define BN_MP_ADDMOD_C
25
+ #define BN_MP_EXPTMOD_C
26
+ #define BN_MP_SET_INT_C
27
+ #define BN_MP_INIT_MULTI_C
28
+ #define BN_MP_CLEAR_MULTI_C
29
+ #define BN_MP_UNSIGNED_BIN_SIZE_C
30
+ #define BN_MP_TO_UNSIGNED_BIN_C
31
+ #define BN_MP_MOD_D_C
32
+ #define BN_MP_PRIME_RABIN_MILLER_TRIALS_C
33
+ #define BN_REVERSE_C
34
+ #define BN_PRIME_TAB_C
35
+
36
+ /* other modifiers */
37
+ #define BN_MP_DIV_SMALL /* Slower division, not critical */
38
+
39
+ /* here we are on the last pass so we turn things off. The functions classes are still there
40
+ * but we remove them specifically from the build. This also invokes tweaks in functions
41
+ * like removing support for even moduli, etc...
42
+ */
43
+ #ifdef LTM_LAST
44
+ #undef BN_MP_TOOM_MUL_C
45
+ #undef BN_MP_TOOM_SQR_C
46
+ #undef BN_MP_KARATSUBA_MUL_C
47
+ #undef BN_MP_KARATSUBA_SQR_C
48
+ #undef BN_MP_REDUCE_C
49
+ #undef BN_MP_REDUCE_SETUP_C
50
+ #undef BN_MP_DR_IS_MODULUS_C
51
+ #undef BN_MP_DR_SETUP_C
52
+ #undef BN_MP_DR_REDUCE_C
53
+ #undef BN_MP_REDUCE_IS_2K_C
54
+ #undef BN_MP_REDUCE_2K_SETUP_C
55
+ #undef BN_MP_REDUCE_2K_C
56
+ #undef BN_S_MP_EXPTMOD_C
57
+ #undef BN_MP_DIV_3_C
58
+ #undef BN_S_MP_MUL_HIGH_DIGS_C
59
+ #undef BN_FAST_S_MP_MUL_HIGH_DIGS_C
60
+ #undef BN_FAST_MP_INVMOD_C
61
+
62
+ /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold
63
+ * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines]
64
+ * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without
65
+ * trouble.
66
+ */
67
+ #undef BN_S_MP_MUL_DIGS_C
68
+ #undef BN_S_MP_SQR_C
69
+ #undef BN_MP_MONTGOMERY_REDUCE_C
70
+ #endif
71
+
72
+ #endif
73
+
74
+ /* $Source$ */
75
+ /* $Revision: 0.36 $ */
76
+ /* $Date: 2005-08-01 16:37:28 +0000 $ */
@@ -0,0 +1,2 @@
1
+ import { RTNCore } from '../types';
2
+ export declare const computeModPow: RTNCore['computeModPow'];
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.computeModPow = void 0;
6
+ const nativeModule_1 = require("../nativeModule");
7
+ const computeModPow = payload => nativeModule_1.nativeModule.computeModPow(payload);
8
+ exports.computeModPow = computeModPow;
9
+ //# sourceMappingURL=computeModPow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeModPow.js","sourceRoot":"","sources":["../../src/apis/computeModPow.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,kDAA+C;AAGxC,MAAM,aAAa,GAA6B,OAAO,CAAC,EAAE,CAChE,2BAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AADxB,QAAA,aAAa,iBACW"}
@@ -0,0 +1,2 @@
1
+ import { RTNCore } from '../types';
2
+ export declare const computeS: RTNCore['computeS'];
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.computeS = void 0;
6
+ const nativeModule_1 = require("../nativeModule");
7
+ const computeS = payload => nativeModule_1.nativeModule.computeS(payload);
8
+ exports.computeS = computeS;
9
+ //# sourceMappingURL=computeS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeS.js","sourceRoot":"","sources":["../../src/apis/computeS.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,kDAA+C;AAGxC,MAAM,QAAQ,GAAwB,OAAO,CAAC,EAAE,CACtD,2BAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AADnB,QAAA,QAAQ,YACW"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { computeModPow } from './apis/computeModPow';
2
+ export { computeS } from './apis/computeS';
package/lib/index.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.computeS = exports.computeModPow = void 0;
6
+ var computeModPow_1 = require("./apis/computeModPow");
7
+ Object.defineProperty(exports, "computeModPow", { enumerable: true, get: function () { return computeModPow_1.computeModPow; } });
8
+ var computeS_1 = require("./apis/computeS");
9
+ Object.defineProperty(exports, "computeS", { enumerable: true, get: function () { return computeS_1.computeS; } });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,sDAAqD;AAA5C,8GAAA,aAAa,OAAA;AACtB,4CAA2C;AAAlC,oGAAA,QAAQ,OAAA"}
@@ -0,0 +1,2 @@
1
+ import { RTNCore } from './types';
2
+ export declare const nativeModule: RTNCore;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.nativeModule = void 0;
6
+ const react_native_1 = require("react-native");
7
+ const LINKING_ERROR = `The package '@aws-amplify/react-native' doesn't seem to be linked. Make sure: \n\n` +
8
+ react_native_1.Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
9
+ '- You rebuilt the app after installing the package\n' +
10
+ '- You are not using Expo Go\n';
11
+ exports.nativeModule = react_native_1.NativeModules.AmplifyRTNCore
12
+ ? react_native_1.NativeModules.AmplifyRTNCore
13
+ : new Proxy({}, {
14
+ get() {
15
+ throw new Error(LINKING_ERROR);
16
+ },
17
+ });
18
+ //# sourceMappingURL=nativeModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeModule.js","sourceRoot":"","sources":["../src/nativeModule.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,+CAAuD;AAGvD,MAAM,aAAa,GAClB,oFAAoF;IACpF,uBAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,gCAAgC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACvE,sDAAsD;IACtD,+BAA+B,CAAC;AAEpB,QAAA,YAAY,GAAY,4BAAa,CAAC,cAAc;IAChE,CAAC,CAAC,4BAAa,CAAC,cAAc;IAC9B,CAAC,CAAC,IAAI,KAAK,CACT,EAAE,EACF;QACC,GAAG;YACF,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;QAChC,CAAC;KACD,CACA,CAAC"}
package/lib/types.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ export interface RTNCore {
2
+ computeModPow(payload: {
3
+ base: string;
4
+ exponent: string;
5
+ divisor: string;
6
+ }): Promise<string>;
7
+ computeS(payload: {
8
+ g: string;
9
+ x: string;
10
+ k: string;
11
+ a: string;
12
+ b: string;
13
+ u: string;
14
+ }): Promise<string>;
15
+ }
package/lib/types.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC"}
@@ -0,0 +1,2 @@
1
+ import { RTNCore } from '../types';
2
+ export declare const computeModPow: RTNCore['computeModPow'];
@@ -0,0 +1,5 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { nativeModule } from '../nativeModule';
4
+ export const computeModPow = payload => nativeModule.computeModPow(payload);
5
+ //# sourceMappingURL=computeModPow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeModPow.js","sourceRoot":"","sources":["../../src/apis/computeModPow.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,MAAM,CAAC,MAAM,aAAa,GAA6B,OAAO,CAAC,EAAE,CAChE,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { RTNCore } from '../types';
2
+ export declare const computeS: RTNCore['computeS'];
@@ -0,0 +1,5 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { nativeModule } from '../nativeModule';
4
+ export const computeS = payload => nativeModule.computeS(payload);
5
+ //# sourceMappingURL=computeS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeS.js","sourceRoot":"","sources":["../../src/apis/computeS.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,MAAM,CAAC,MAAM,QAAQ,GAAwB,OAAO,CAAC,EAAE,CACtD,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { computeModPow } from './apis/computeModPow';
2
+ export { computeS } from './apis/computeS';
@@ -0,0 +1,5 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { computeModPow } from './apis/computeModPow';
4
+ export { computeS } from './apis/computeS';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { RTNCore } from './types';
2
+ export declare const nativeModule: RTNCore;
@@ -0,0 +1,15 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { NativeModules, Platform } from 'react-native';
4
+ const LINKING_ERROR = `The package '@aws-amplify/react-native' doesn't seem to be linked. Make sure: \n\n` +
5
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
6
+ '- You rebuilt the app after installing the package\n' +
7
+ '- You are not using Expo Go\n';
8
+ export const nativeModule = NativeModules.AmplifyRTNCore
9
+ ? NativeModules.AmplifyRTNCore
10
+ : new Proxy({}, {
11
+ get() {
12
+ throw new Error(LINKING_ERROR);
13
+ },
14
+ });
15
+ //# sourceMappingURL=nativeModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeModule.js","sourceRoot":"","sources":["../src/nativeModule.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGvD,MAAM,aAAa,GAClB,oFAAoF;IACpF,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,gCAAgC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACvE,sDAAsD;IACtD,+BAA+B,CAAC;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAY,aAAa,CAAC,cAAc;IAChE,CAAC,CAAC,aAAa,CAAC,cAAc;IAC9B,CAAC,CAAC,IAAI,KAAK,CACT,EAAE,EACF;QACC,GAAG;YACF,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;QAChC,CAAC;KACD,CACA,CAAC"}
@@ -0,0 +1,15 @@
1
+ export interface RTNCore {
2
+ computeModPow(payload: {
3
+ base: string;
4
+ exponent: string;
5
+ divisor: string;
6
+ }): Promise<string>;
7
+ computeS(payload: {
8
+ g: string;
9
+ x: string;
10
+ k: string;
11
+ a: string;
12
+ b: string;
13
+ u: string;
14
+ }): Promise<string>;
15
+ }
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC"}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@aws-amplify/react-native",
3
+ "version": "1.0.1-console-preview.deaebd5.0+deaebd5",
4
+ "description": "React Native core module for aws-amplify",
5
+ "main": "./lib/index.js",
6
+ "module": "./lib-esm/index.js",
7
+ "typings": "./lib-esm/index.d.ts",
8
+ "sideEffects": false,
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "scripts": {
13
+ "test": "tslint 'src/**/*.ts'",
14
+ "test:android": "./android/gradlew test -p ./android",
15
+ "build-with-test": "npm run clean && npm test && tsc",
16
+ "build:cjs": "rimraf lib && tsc -p ./tsconfig.build.json -m commonjs --outDir lib",
17
+ "build:esm": "rimraf lib-esm && tsc -p ./tsconfig.build.json -m esnext --outDir lib-esm",
18
+ "build:cjs:watch": "rimraf lib && tsc -p ./tsconfig.build.json -m commonjs --outDir lib --watch",
19
+ "build:esm:watch": "rimraf lib-esm && tsc -p ./tsconfig.build.json -m esnext --outDir lib-esm --watch",
20
+ "build": "npm run clean && npm run build:esm && npm run build:cjs",
21
+ "clean": "rimraf lib-esm lib dist",
22
+ "format": "echo \"Not implemented\"",
23
+ "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
24
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 88.21"
25
+ },
26
+ "peerDependencies": {
27
+ "react-native": ">=0.70"
28
+ },
29
+ "devDependencies": {
30
+ "@types/react-native": "0.70.0",
31
+ "react-native": "0.70.0",
32
+ "typescript": "5.1.6"
33
+ },
34
+ "react-native": {
35
+ "./lib/index": "./lib-esm/index.js"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/aws-amplify/amplify-js.git"
40
+ },
41
+ "author": "Amazon Web Services",
42
+ "license": "Apache-2.0",
43
+ "bugs": {
44
+ "url": "https://github.com/aws-amplify/amplify-js/issues"
45
+ },
46
+ "homepage": "https://docs.amplify.aws/",
47
+ "files": [
48
+ "Amplify*.podspec",
49
+ "android",
50
+ "ios",
51
+ "lib",
52
+ "lib-esm",
53
+ "src"
54
+ ],
55
+ "source": "src/index",
56
+ "gitHead": "deaebd5a938733ff2b25aaec39c042843ef2289c"
57
+ }
@@ -0,0 +1,8 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { nativeModule } from '../nativeModule';
5
+ import { RTNCore } from '../types';
6
+
7
+ export const computeModPow: RTNCore['computeModPow'] = payload =>
8
+ nativeModule.computeModPow(payload);
@@ -0,0 +1,8 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { nativeModule } from '../nativeModule';
5
+ import { RTNCore } from '../types';
6
+
7
+ export const computeS: RTNCore['computeS'] = payload =>
8
+ nativeModule.computeS(payload);
package/src/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export { computeModPow } from './apis/computeModPow';
5
+ export { computeS } from './apis/computeS';
@@ -0,0 +1,22 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { NativeModules, Platform } from 'react-native';
5
+ import { RTNCore } from './types';
6
+
7
+ const LINKING_ERROR =
8
+ `The package '@aws-amplify/react-native' doesn't seem to be linked. Make sure: \n\n` +
9
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
10
+ '- You rebuilt the app after installing the package\n' +
11
+ '- You are not using Expo Go\n';
12
+
13
+ export const nativeModule: RTNCore = NativeModules.AmplifyRTNCore
14
+ ? NativeModules.AmplifyRTNCore
15
+ : new Proxy(
16
+ {},
17
+ {
18
+ get() {
19
+ throw new Error(LINKING_ERROR);
20
+ },
21
+ }
22
+ );
package/src/types.ts ADDED
@@ -0,0 +1,19 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export interface RTNCore {
5
+ computeModPow(payload: {
6
+ base: string;
7
+ exponent: string;
8
+ divisor: string;
9
+ }): Promise<string>;
10
+
11
+ computeS(payload: {
12
+ g: string;
13
+ x: string;
14
+ k: string;
15
+ a: string;
16
+ b: string;
17
+ u: string;
18
+ }): Promise<string>;
19
+ }