11 #define uECC_arch_other 0 15 #define uECC_arm_thumb 4 17 #define uECC_arm_thumb2 6 28 #define uECC_asm_none 0 29 #define uECC_asm_small 1 30 #define uECC_asm_fast 2 32 #define uECC_ASM uECC_asm_fast 36 #define uECC_secp160r1 1 37 #define uECC_secp192r1 2 38 #define uECC_secp256r1 3 39 #define uECC_secp256k1 4 40 #define uECC_secp224r1 5 42 #define uECC_CURVE uECC_secp256r1 48 #ifndef uECC_SQUARE_FUNC 49 #define uECC_SQUARE_FUNC 1 52 #define uECC_CONCAT1(a, b) a##b 53 #define uECC_CONCAT(a, b) uECC_CONCAT1(a, b) 55 #define uECC_size_1 20 56 #define uECC_size_2 24 57 #define uECC_size_3 32 58 #define uECC_size_4 32 59 #define uECC_size_5 28 61 #define uECC_BYTES uECC_CONCAT(uECC_size_, uECC_CURVE) 84 typedef int (*uECC_RNG_Function)(uint8_t *dest,
unsigned size);
96 void uECC_set_rng(uECC_RNG_Function rng_function);
107 int uECC_make_key(uint8_t public_key[uECC_BYTES*2], uint8_t private_key[uECC_BYTES]);
123 int uECC_shared_secret(
const uint8_t public_key[uECC_BYTES*2],
124 const uint8_t private_key[uECC_BYTES],
125 uint8_t secret[uECC_BYTES]);
142 int uECC_sign(
const uint8_t private_key[uECC_BYTES],
143 const uint8_t message_hash[uECC_BYTES],
144 uint8_t signature[uECC_BYTES*2]);
187 const uint8_t *message,
188 unsigned message_size);
189 void (*finish_hash)(
struct uECC_HashContext *context, uint8_t *hash_result);
191 unsigned result_size;
214 int uECC_sign_deterministic(
const uint8_t private_key[uECC_BYTES],
215 const uint8_t message_hash[uECC_BYTES],
217 uint8_t signature[uECC_BYTES*2]);
232 int uECC_verify(
const uint8_t private_key[uECC_BYTES*2],
233 const uint8_t hash[uECC_BYTES],
234 const uint8_t signature[uECC_BYTES*2]);
245 void uECC_compress(
const uint8_t public_key[uECC_BYTES*2], uint8_t compressed[uECC_BYTES+1]);
256 void uECC_decompress(
const uint8_t compressed[uECC_BYTES+1], uint8_t public_key[uECC_BYTES*2]);
270 int uECC_valid_public_key(
const uint8_t public_key[uECC_BYTES*2]);
283 int uECC_compute_public_key(
const uint8_t private_key[uECC_BYTES],
284 uint8_t public_key[uECC_BYTES * 2]);
290 int uECC_bytes(
void);
295 int uECC_curve(
void);
Platform-independent data types.