File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 2
2
.DS_Store
3
3
node_modules
4
4
package-lock.json
5
+ circuits /gg
Original file line number Diff line number Diff line change 5
5
6
6
'use strict' ;
7
7
8
- const fs = require ( 'fs' ) . promises ;
8
+ const fs = require ( 'fs' ) ;
9
9
10
10
const circuit = require ( '../../src/data/circuit' ) ;
11
11
const garble = require ( '../../src/garble' ) ;
@@ -26,16 +26,16 @@ async function generateGarbledGates(filenames, index) {
26
26
}
27
27
28
28
var timeStart = ( new Date ( ) ) . getTime ( ) ;
29
- let raw = await fs . readFile ( './circuits/bristol/' + filenames [ index ] + '.txt' , 'utf8' ) ;
29
+ let raw = await fs . promises . readFile ( './circuits/bristol/' + filenames [ index ] + '.txt' , 'utf8' ) ;
30
30
let c = circuit . fromBristolFashion ( raw ) ;
31
31
32
32
let wToLs_G = garble . generateWireToLabelsMap ( c ) ;
33
33
let assignmentPathAndFile = './circuits/gg/' + filenames [ index ] + '.assignment.json' ;
34
- fs . writeFile ( assignmentPathAndFile , wToLs_G . toJSONString ( ) ) ;
34
+ fs . promises . writeFile ( assignmentPathAndFile , wToLs_G . toJSONString ( ) ) ;
35
35
36
36
let gatesGarbled_G = garble . garbleGates ( c , wToLs_G ) ;
37
37
let ggPathAndFile = './circuits/gg/' + filenames [ index ] + '.gg.json' ;
38
- fs . writeFile ( ggPathAndFile , gatesGarbled_G . toJSONString ( ) ) ;
38
+ fs . promises . writeFile ( ggPathAndFile , gatesGarbled_G . toJSONString ( ) ) ;
39
39
40
40
var timeEnd = ( new Date ( ) ) . getTime ( ) ;
41
41
console . log ( ' * generated ' + filenames [ index ] + '.*.json (' + ( timeEnd - timeStart ) + 'ms)' )
You can’t perform that action at this time.
0 commit comments