ECC ecc_sign+verify_hash_raw > ecc_sign+verify_hash_rfc7518#235
ECC ecc_sign+verify_hash_raw > ecc_sign+verify_hash_rfc7518#235
Conversation
| int ecc_sign_hash_raw(const unsigned char *in, unsigned long inlen, | ||
| void *r, void *s, | ||
| prng_state *prng, int wprng, ecc_key *key) | ||
| static int ecc_sign_hash_ex(const unsigned char *in, unsigned long inlen, |
There was a problem hiding this comment.
_ecc_sign_hash_ex
even better _ecc_sign_hash
| } | ||
|
|
||
| /* make up a key and export the public copy */ | ||
| for (;;) { |
There was a problem hiding this comment.
I just realized we're also probably looping here forever... as we should keep it consistent either we add a limit here or we remove it again in DH
There was a problem hiding this comment.
I have added max_iterations, I am just not sure if it is worth another new define.
| if ((err = ltc_mp.ecc_ptmul(u1, mG, mG, m, 0)) != CRYPT_OK) { goto error; } | ||
| if ((err = ltc_mp.ecc_ptmul(u2, mQ, mQ, m, 0)) != CRYPT_OK) { goto error; } | ||
|
|
||
| /* find the montgomery mp */ |
There was a problem hiding this comment.
IIUC this removal leads to mp being used uninitialized.
If that's okay then we can also remove it entirely.
There was a problem hiding this comment.
It was mistake, I was removing some code related to curves with custom A and removed also this one.
| void *e, *p; | ||
| int err; | ||
| void *r, *s, *e, *p; | ||
| int err, max_iterations = 20; |
There was a problem hiding this comment.
probably we could introduce PK_MAX_RETRIES or something like that which can be used in all PK algorithms where we have to do retry-loops (c.f. DH_MAKE_KEY_MAX_ITERATIONS)? Otherwise we should use a separate one here as well.
ecc_sign_hash_raw() and ecc_verify_hash_raw() have been removed from upstream LibTomCrypt [1]. This patch imports the LTC modification and updates tee_ltc_provider.c accordingly. Tested with: xtest -l 15 4006. Link: [1] libtom/libtomcrypt#235 Link: libtom/libtomcrypt#228 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey)
related to #228 point 7/