Today I encountered a "strange thing ":ProgramThousands of logs can be normally output and all logs can be output. However, when redirected to a file, there are always dozens of logs missing. The output is similar to logs and logs.
Later, Xiao Wu told me that it was a matter of row buffering. That's true. Just add fflush.
Why is this problem?
1. We want to implement ISAKMP's elliptic curve key exchange, so we need to first implement the basic operation of the elliptic curve, that is, points + points and points * points. The SEC test data is used, but the result is always incorrect. Therefore, the debugging information is added during each operation to output the operation result;
2. I finally got it right today, so I can see the missing information for the last few days.
During the spec160r1 test, I got an elliptic curve for more than a week.
Write down this formula: A mod B =
-B * (A/B)