Fix a logic error in deterministic PRNG with buffer overrun issue#52
Fix a logic error in deterministic PRNG with buffer overrun issue#52concise wants to merge 1 commit intokmackay:masterfrom
Conversation
|
Note that if #51 is accepted, this pull request can be discarded and closed. |
|
Oh, maybe I was doing nonsense. I didn't realized the usage for #if (uECC_CURVE == uECC_secp160r1 ||
uECC_CURVE == uECC_secp224r1) && (uECC_WORD_SIZE == 8)
#undef uECC_WORD_SIZE
#define uECC_WORD_SIZE 4
#if (uECC_PLATFORM == uECC_x86_64)
#undef uECC_PLATFORM
#define uECC_PLATFORM uECC_x86
#endif
#endifYet, since the macros for domain parameters of secp160r1 when |
|
I am planning to change micro-ecc to support runtime curve selection (see the 'runtime' branch). I think the implementation in that branch is correct for 8-byte words already. You may want to base your RFC 6979 work on the runtime branch instead of master, since I will be replacing master with the runtime version as soon as it is ready (I need to add some more optimizations and AVR support). |
In
uECC_sign_deterministic, whenuECC_WORD_SIZEis 8, the array declaration for T becomesuint64_t T[3];and the following codebecomes
I think that is not what we want (to keep only 161 pseudo-random bits so that 0 <= k <= 2^161-1) and the code in that case should be
The entire code block may be changed into something like this: