YPC  0.2.0
secp256k1.h
1 #pragma once
2 #include <cstdint>
3 
4 namespace ypc {
5 namespace crypto {
6 struct secp256k1 {
7  inline static uint32_t get_private_key_size() { return 32; }
8  inline static uint32_t get_public_key_size() { return 64; }
9  static uint32_t gen_private_key(uint32_t skey_size, uint8_t *skey);
10 
11  static uint32_t generate_pkey_from_skey(const uint8_t *skey,
12  uint32_t skey_size, uint8_t *pkey,
13  uint32_t pkey_size);
14 
15  static uint32_t get_signature_size();
16 
17  static uint32_t sign_message(const uint8_t *skey, uint32_t skey_size,
18  const uint8_t *data, uint32_t data_size,
19  uint8_t *sig, uint32_t sig_size);
20 
21  static uint32_t verify_signature(const uint8_t *data, uint32_t data_size,
22  const uint8_t *sig, uint32_t sig_size,
23  const uint8_t *public_key,
24  uint32_t pkey_size);
25 };
26 } // namespace crypto
27 } // namespace ypc
ypc::crypto::secp256k1
Definition: secp256k1.h:6