mirror of
https://github.com/tornadocash/trusted-setup-server.git
synced 2024-12-22 09:13:15 +01:00
Merge branch 'master' of github.com:tornadocash/trusted-setup-server
This commit is contained in:
commit
74edcd4fec
@ -187,14 +187,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
|
||||
|
@ -8,7 +8,6 @@ const aws = require('aws-sdk')
|
||||
const express = require('express')
|
||||
const { Mutex } = require('async-mutex')
|
||||
const multer = require('multer')
|
||||
const blake2 = require('blake2')
|
||||
|
||||
const mutex = new Mutex()
|
||||
const s3 = new aws.S3()
|
||||
@ -88,14 +87,14 @@ router.post('/response', upload.single('response'), async (req, res) => {
|
||||
await uploadToS3({ filename: req.file.filename, contributionIndex })
|
||||
}
|
||||
console.log('Committing changes')
|
||||
await Contribution.create({ name, company, handle, socialType, token })
|
||||
|
||||
await fs.copyFile(`/tmp/tornado/${req.file.filename}`, './server/snark_files/current.params')
|
||||
await fs.copyFile(
|
||||
'./server/snark_files/current.params',
|
||||
`./server/snark_files/response_${contributionIndex}`
|
||||
)
|
||||
|
||||
await Contribution.create({ name, company, handle, socialType, token })
|
||||
|
||||
console.log('Contribution finished.')
|
||||
res.json({ contributionIndex, token })
|
||||
} catch (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user