Compare commits

..

1 Commits

Author SHA1 Message Date
krlosMata
0133981b75 define 4 bytes for FieldDef 2020-02-28 08:33:19 +01:00
2 changed files with 4 additions and 16 deletions

View File

@@ -118,18 +118,6 @@ void writeOutBin(Circom_CalcWit *ctx, std::string filename) {
write_ptr = fopen(filename.c_str(),"wb"); write_ptr = fopen(filename.c_str(),"wb");
// Add header
// 4 bytes --> total number of constraints
uint32_t witnessLength = _circuit.NVars;
// 4 bytes --> witness element size (measured in number of 32bit words)
uint32_t witnessSize = 8; // witness size = 8*32 = 256 bits
// 8bytes --> empty
uint64_t otherField = 0;
fwrite(&witnessLength, 4, 1, write_ptr);
fwrite(&witnessSize, 4, 1, write_ptr);
fwrite(&otherField, 8, 1, write_ptr);
FrElement v; FrElement v;
u8 buffOut[256]; u8 buffOut[256];

View File

@@ -152,9 +152,9 @@ Size in bytes of the section
Section Type: 0x01 Section Type: 0x01
```` ````
┏━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┏━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ 4 │ FieldDefSize ┃ FieldDef field Id ┃ 4 │ FieldDefSize ┃ 4 ┃FieldDef field Id
┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━━━━┳━━━━━━━━━━━━━━━━━┓ ┏━━━━┳━━━━━━━━━━━━━━━━━┓
┃ 4 │ 00 00 00 00 ┃ bigInt Format ┃ 4 │ 00 00 00 00 ┃ bigInt Format
┗━━━━┻━━━━━━━━━━━━━━━━━┛ ┗━━━━┻━━━━━━━━━━━━━━━━━┛
@@ -501,7 +501,7 @@ The format will be:
```` ````
┏━━━━━━━━━━━━━━┓ ┏━━━━━━━━━━━━━━┓
┃ 72 31 63 77 ┃ Magic ┃ 72 31 63 73 ┃ Magic
┣━━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━━┫
┃ 01 00 00 00 ┃ Version ┃ 01 00 00 00 ┃ Version
┣━━━━━━━━━━━━━━┫ ┣━━━━━━━━━━━━━━┫