Skip to content

Commit

Permalink
Remove unneeded comments
Browse files Browse the repository at this point in the history
  • Loading branch information
OBrezhniev committed Dec 26, 2023
1 parent 4a47371 commit ff65b99
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/witnesscalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Circom_Circuit* loadCircuit(const void *buffer, unsigned long buffer_size) {
circuit->InputHashMap = new HashSignalInfo[get_size_of_input_hashmap()];
uint dsize = get_size_of_input_hashmap()*sizeof(HashSignalInfo);
if (buffer_size < dsize) {
//Add this code snippet to prevent potential memory errors.
throw std::runtime_error("Invalid circuit file: buffer_size <= dsize");
}
memcpy((void *)(circuit->InputHashMap), (void *)bdata, dsize);
Expand All @@ -31,7 +30,6 @@ Circom_Circuit* loadCircuit(const void *buffer, unsigned long buffer_size) {
uint inisize = dsize;
dsize = get_size_of_witness()*sizeof(u64);
if (buffer_size < dsize + inisize) {
//Add this code snippet to prevent potential memory errors.
throw std::runtime_error("Invalid circuit file: buffer_size <= dsize + inisize");
}
memcpy((void *)(circuit->witness2SignalList), (void *)(bdata+inisize), dsize);
Expand All @@ -41,7 +39,6 @@ Circom_Circuit* loadCircuit(const void *buffer, unsigned long buffer_size) {
inisize += dsize;
dsize = get_size_of_constants()*sizeof(FrElement);
if (buffer_size < dsize + inisize) {
//Add this code snippet to prevent potential memory errors.
throw std::runtime_error("Invalid circuit file: buffer_size <= dsize + inisize");
}
memcpy((void *)(circuit->circuitConstants), (void *)(bdata+inisize), dsize);
Expand All @@ -53,7 +50,6 @@ Circom_Circuit* loadCircuit(const void *buffer, unsigned long buffer_size) {
inisize += dsize;
dsize = get_size_of_io_map()*sizeof(u32);
if (buffer_size < dsize + inisize) {
//Add this code snippet to prevent potential memory errors.
throw std::runtime_error("Invalid circuit file: buffer_size <= dsize + inisize");
}
memcpy((void *)index, (void *)(bdata+inisize), dsize);
Expand All @@ -62,7 +58,6 @@ Circom_Circuit* loadCircuit(const void *buffer, unsigned long buffer_size) {
throw std::runtime_error("Invalid circuit file: wrong inisize");
}
if (buffer_size <= inisize) {
//Add this code snippet to prevent potential memory errors.
throw std::runtime_error("Invalid circuit file: buffer_size <= inisize");
}
u32 dataiomap[(buffer_size-inisize)/sizeof(u32)];
Expand Down

0 comments on commit ff65b99

Please sign in to comment.