@aws-amplify/auth
Version:
Auth category of aws-amplify
29 lines (27 loc) • 873 B
JavaScript
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateS = void 0;
/**
* @internal
*/
const calculateS = async ({ a, g, k, x, B, N, U, }) => {
return new Promise((resolve, reject) => {
g.modPow(x, N, (outerErr, outerResult) => {
if (outerErr) {
reject(outerErr);
return;
}
B.subtract(k.multiply(outerResult)).modPow(a.add(U.multiply(x)), N, (innerErr, innerResult) => {
if (innerErr) {
reject(innerErr);
return;
}
resolve(innerResult.mod(N));
});
});
});
};
exports.calculateS = calculateS;
//# sourceMappingURL=calculateS.js.map
;