mirror of
https://github.com/tornadocash/trusted-setup-server.git
synced 2024-11-21 17:36:54 +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
|
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
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user