Merge branch 'master' of github.com:tornadocash/trusted-setup-server

This commit is contained in:
Roman Storm 2020-04-29 12:28:41 -07:00
commit 74edcd4fec
No known key found for this signature in database
GPG Key ID: 522F2A785F34E71F
2 changed files with 5 additions and 8 deletions

View File

@ -187,14 +187,12 @@ export default {
await timeout(100) // allow UI to update before freezing in wasm await timeout(100) // allow UI to update before freezing in wasm
console.log('Source params', data) console.log('Source params', data)
let msgBuffer = new TextEncoder('utf-8').encode(userInput) const msgBuffer = new TextEncoder('utf-8').encode(userInput)
let hashBuffer = await window.crypto.subtle.digest('SHA-256', msgBuffer) const hashBuffer = await window.crypto.subtle.digest('SHA-256', msgBuffer)
const entropyFromUser = new Uint8Array(hashBuffer) const entropyFromUser = new Uint8Array(hashBuffer)
// console.log('entropyFromUser', entropyFromUser.toString()) // console.log('entropyFromUser', entropyFromUser.toString())
msgBuffer = window.crypto.getRandomValues(new Uint8Array(1024)) const entropyFromBrowser = window.crypto.getRandomValues(new Uint8Array(32))
hashBuffer = await window.crypto.subtle.digest('SHA-256', msgBuffer)
const entropyFromBrowser = new Uint8Array(hashBuffer)
// console.log('entropyFromBrowser', entropyFromBrowser.toString()) // console.log('entropyFromBrowser', entropyFromBrowser.toString())
// suffle the browser and user random // suffle the browser and user random

View File

@ -8,7 +8,6 @@ const aws = require('aws-sdk')
const express = require('express') const express = require('express')
const { Mutex } = require('async-mutex') const { Mutex } = require('async-mutex')
const multer = require('multer') const multer = require('multer')
const blake2 = require('blake2')
const mutex = new Mutex() const mutex = new Mutex()
const s3 = new aws.S3() 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 }) await uploadToS3({ filename: req.file.filename, contributionIndex })
} }
console.log('Committing changes') 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(`/tmp/tornado/${req.file.filename}`, './server/snark_files/current.params')
await fs.copyFile( await fs.copyFile(
'./server/snark_files/current.params', './server/snark_files/current.params',
`./server/snark_files/response_${contributionIndex}` `./server/snark_files/response_${contributionIndex}`
) )
await Contribution.create({ name, company, handle, socialType, token })
console.log('Contribution finished.') console.log('Contribution finished.')
res.json({ contributionIndex, token }) res.json({ contributionIndex, token })
} catch (e) { } catch (e) {