-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1 Add method to perform PBKDF2 in WebAssembly to help support experi…
…ence in MS Edge
- Loading branch information
Ernie Turner
committed
Jan 7, 2019
1 parent
3553414
commit c23df75
Showing
8 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
declare const Benchmark: any; | ||
|
||
export default (Recrypt: typeof import("../lib/Api256Shim"), logResult: (results: string) => void) => { | ||
//prettier-ignore | ||
const salt = new Uint8Array([138, 136, 227, 221, 116, 9, 241, 149, 253, 82, 219, 45, 60, 186, 93, 114, 202, 103, 9, 191, 29, 148, 18, 27, 243, 116, 136, 1, 180, 15, 111, 92]); | ||
const iterations = 250000; | ||
const password = new Uint8Array([112, 97, 115, 115, 119, 111, 114, 100]); | ||
|
||
return new Benchmark("pbkdf2SHA256", { | ||
fn: () => { | ||
Recrypt.pbkdf2SHA256(salt, password, iterations); | ||
}, | ||
onError: (err: Error) => { | ||
console.log(err); | ||
}, | ||
onComplete: (result: any) => { | ||
const resultString = result.currentTarget.toString(); | ||
logResult(resultString); | ||
console.log(result.currentTarget.toString()); | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters