19#include "hitls_build.h"
20#ifdef HITLS_CRYPTO_ECC
24#include "crypt_errno.h"
40inline static void DecodeScalarCode(uint32_t *sign, uint32_t *value, uint32_t code)
43 s = 0 - (code >> WINDOW_SIZE);
45 v = (code >> 1) + (code & 1);
48 v = (~s & v) | (s & (~v + 1));
51 *value = v & ((1 << WINDOW_SIZE) - 1);
54inline static int32_t CheckBnValid(
const BN_BigNum *k, uint32_t maxBits)
56 if (BN_Bits(k) > maxBits) {
57 return CRYPT_ECC_POINT_MUL_ERR_K_LEN;
#define CRYPT_SUCCESS
Return success
定义 crypt_errno.h:33