Fixes #100. We can assume it is working.
without assert(0) the else if block works fine. There are no errors, builds and runs successfully.
Have you actually tested that? I doubt that the following part works:
htobe64(val);
TGLC_bn_bin2bn ((unsigned char *) &val, 8, b);
It should probably say:
val = htobe64(val);
TGLC_bn_bin2bn ((unsigned char *) &val, 8, b);
... because htobe64 doesn't write into val, nothing happens on Little Endian systems, so I would be surprised if that actually does something useful.
EDIT: Yeah, I'm aware that I wrote that code. These two lines are broken nevertheless.
The case was like this. I cloned everything, then configure, make and everything. It gave me the assert error on that line. When I went to the code this was the place that was broken, so I removed the assert(0) and everything worked fine. So, yes I had to test it to make it run.
You mentioned one assert-induced crash, but removed two asserts. Which one crashed? And what argument do you have about why the "probably-faulty" code could possibly work?