Skip to content

Commit

Permalink
chore: add notice and remove changes comment (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcallister0210 authored Apr 15, 2023
1 parent a4a94c5 commit a6dd0cb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
File renamed without changes.
21 changes: 21 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Cognito SRP Helper
Copyright 2022 Simon McAllister

This product includes software developed at
Amazon Cognito Identity Provider SDK for JavaScript (https://github.com/aws-amplify/amplify-js/tree/main/packages/amazon-cognito-identity-js)

==== Amazon Cognito Identity Provider SDK for JavaScript ====
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

==== Modifications ====
Modifications to the Amazon Cognito Identity Provider SDK in Cognito SRP Helper:

- Renamed and moved `infoBits`, `N`, `g`, `k` properties in `AuthenticationHelper.js` to `constants.ts`
- Renamed and moved `generateRandomSmallA`, `calculateA`, `calculateU`, `computehkdf`, `calculateS`
- Moved `hash`, `hexHash`, `padHex`, `randomBytes` functions from `AuthenticationHelper.js` to `util.ts`
- Modified functions to remove callbacks
- Modified functions to use new constants
- Modified functions to use `crypto-js` library for HMAC, WordArrays, and Base64 encoding
- Modified functions to use `jsbn` library instead of `BigInteger`
- Modified functions to throw custom errors for easier error handling
- Use version `6.0.3` of `buffer` library
9 changes: 0 additions & 9 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

/*
CHANGES:
In the Amplify implementation, they use their own private implementation of
BigInteger, but this is just a small copy of JSBN:
http://www-cs-students.stanford.edu/~tjw/jsbn/. This code is packaged by jsbn,
so we'll use that instead. They also use their own implementation of WordArray
but we use the CryptoJS implementation for this instead
*/

import { Buffer } from "buffer/index.js"; // use the browser compatible buffer library
import CryptoJS from "crypto-js";
import { BigInteger } from "jsbn";
Expand Down

0 comments on commit a6dd0cb

Please sign in to comment.