fix(ML302): Fixed errors in generating private keys
issue
@@ -399,9 +399,6 @@ static BOAT_RESULT sBoatPort_keyCreate_internal_generation(const BoatWalletPriKe
BUINT32 key_try_count;
BOAT_RESULT result = BOAT_SUCCESS;
- /* Convert private key from UINT256 to Bignum256 format */
- bn_read_le(prikeyTmp, &priv_key_bn256);
-
/* Convert priv_key_max_u256 from UINT256 to Bignum256 format */
bn_read_le((const uint8_t *)priv_key_max_u256, &priv_key_max_bn256);
@@ -417,6 +414,9 @@ static BOAT_RESULT sBoatPort_keyCreate_internal_generation(const BoatWalletPriKe
break;
}
+ /* Convert private key from UINT256 to Bignum256 format */
+ bn_read_le(prikeyTmp, &priv_key_bn256);
+
/* check the generated private key is valid or not */
if ((bn_is_zero(&priv_key_bn256) == 0) && \
(bn_is_less(&priv_key_bn256, &priv_key_max_bn256) != 0))
