psa_generate_derived_key_internal, psa_generate_derived_ecc_key_weierstrass_helper: optimize the code

Perform the following optimizations:
- fix used flags for conditional compilation
- remove redundant N variable
- move loop used to generate valid k value to helper function
- fix initial value of status
- fix comments

Signed-off-by: Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
Przemyslaw Stekiel 2022-01-20 22:41:17 +01:00
parent 924815982a
commit 6d3d18b2dc
2 changed files with 51 additions and 50 deletions

View file

@ -553,6 +553,9 @@
((type) & PSA_KEY_TYPE_ECC_CURVE_MASK) : \
0))
/** Check if the curve of given family is Weierstrass elliptic curve. */
#define PSA_ECC_FAMILY_IS_WEIERSTRASS(family) ((family & 0xc0) == 0)
/** SEC Koblitz curves over prime fields.
*
* This family comprises the following curves: