libtomcrypt icon indicating copy to clipboard operation
libtomcrypt copied to clipboard

Identical condition

Open maddin200 opened this issue 4 years ago • 3 comments

/src/math/fp/ltc_ecc_fp_mulmod.c line 1078 Code: if (zB && first == 0) { if (zB) { // <-- identical if ((err = ltc_mp.ecc_ptadd(R, fp_cache[idx2].LUT[zB], R, a, modulus, mp)) != CRYPT_OK) { return err; } }

maddin200 avatar Jan 29 '21 11:01 maddin200

That does indeed appear to be a redundant check.

Would you be able to open a PR with a fix?

jamuir avatar Feb 21 '21 18:02 jamuir

not so familiar with the code

maddin200 avatar Feb 22 '21 08:02 maddin200

no worries, I already had a look at that finding because I was like "come on, this can't change anything in the generated code" ... aaaand I was wrong ... I played a bit around with it, but didn't come to a conclusion yet on how it should be written, resp. whether we should even touch it since #410 is still open and undecided...

sjaeckel avatar Feb 22 '21 09:02 sjaeckel