mirror of
https://github.com/tornadocash/trusted-setup-server.git
synced 2024-11-24 02:46:33 +01:00
fix random
This commit is contained in:
parent
0dde625894
commit
11fcf8e1e0
@ -186,14 +186,12 @@ export default {
|
||||
await timeout(100) // allow UI to update before freezing in wasm
|
||||
console.log('Source params', data)
|
||||
|
||||
let msgBuffer = new TextEncoder('utf-8').encode(userInput)
|
||||
let hashBuffer = await window.crypto.subtle.digest('SHA-256', msgBuffer)
|
||||
const msgBuffer = new TextEncoder('utf-8').encode(userInput)
|
||||
const hashBuffer = await window.crypto.subtle.digest('SHA-256', msgBuffer)
|
||||
const entropyFromUser = new Uint8Array(hashBuffer)
|
||||
// console.log('entropyFromUser', entropyFromUser.toString())
|
||||
|
||||
msgBuffer = window.crypto.getRandomValues(new Uint8Array(1024))
|
||||
hashBuffer = await window.crypto.subtle.digest('SHA-256', msgBuffer)
|
||||
const entropyFromBrowser = new Uint8Array(hashBuffer)
|
||||
const entropyFromBrowser = window.crypto.getRandomValues(new Uint8Array(32))
|
||||
// console.log('entropyFromBrowser', entropyFromBrowser.toString())
|
||||
|
||||
// suffle the browser and user random
|
||||
|
Loading…
Reference in New Issue
Block a user