UNPKG

@aws-amplify/auth

Version:
1 lines 1.34 kB
{"version":3,"file":"calculateA.mjs","sources":["../../../../../../../src/providers/cognito/utils/srp/calculate/calculateA.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BigInteger } from '../BigInteger';\n/**\n * @internal\n */\nexport const calculateA = async ({ a, g, N, }) => {\n return new Promise((resolve, reject) => {\n g.modPow(a, N, (err, A) => {\n if (err) {\n reject(err);\n return;\n }\n if (A.mod(N).equals(BigInteger.ZERO)) {\n reject(new Error('Illegal parameter. A mod N cannot be 0.'));\n return;\n }\n resolve(A);\n });\n });\n};\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACA;AACA;AACY,MAAC,UAAU,GAAG,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK;AAClD,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC5C,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK;AACnC,YAAY,IAAI,GAAG,EAAE;AACrB,gBAAgB,MAAM,CAAC,GAAG,CAAC;AAC3B,gBAAgB;AAChB;AACA,YAAY,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AAClD,gBAAgB,MAAM,CAAC,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;AAC5E,gBAAgB;AAChB;AACA,YAAY,OAAO,CAAC,CAAC,CAAC;AACtB,SAAS,CAAC;AACV,KAAK,CAAC;AACN;;;;"}