ec.h (1228B)
1 2 #ifndef EC_H 3 #define EC_H 4 5 #include <stdlib.h> 6 #include "secp256k1.h" 7 8 /** The length of a private key used for EC signing */ 9 #define EC_PRIVATE_KEY_LEN 32 10 /** The length of a public key used for EC signing */ 11 #define EC_PUBLIC_KEY_LEN 33 12 /** The length of an uncompressed public key */ 13 #define EC_PUBLIC_KEY_UNCOMPRESSED_LEN 65 14 /** The length of a message hash to EC sign */ 15 #define EC_MESSAGE_HASH_LEN 32 16 /** The length of a compact signature produced by EC signing */ 17 #define EC_SIGNATURE_LEN 64 18 /** The maximum encoded length of a DER encoded signature */ 19 #define EC_SIGNATURE_DER_MAX_LEN 72 20 /** The maximum encoded length of a DER encoded signature created with EC_FLAG_GRIND_R */ 21 #define EC_SIGNATURE_DER_MAX_LOW_R_LEN 71 22 23 /** Indicates that a signature using ECDSA/secp256k1 is required */ 24 #define EC_FLAG_ECDSA 0x1 25 /** Indicates that a signature using EC-Schnorr-SHA256 is required */ 26 #define EC_FLAG_SCHNORR 0x2 27 /** Indicates that the signature nonce should be incremented until the signature is low-R */ 28 #define EC_FLAG_GRIND_R 0x4 29 30 int wally_ec_public_key_from_private_key( 31 const secp256k1_context *ctx, const unsigned char *priv_key, 32 size_t priv_key_len, unsigned char *bytes_out, size_t len); 33 34 #endif /* EC_H */