|
void | getHash (const uint8_t *pData, size_t size, uint8_t hash[IOTEX_HASH_SIZE]) |
| Get the kekkac 256 hash. More...
|
|
void | getEthereumMessageHash (const uint8_t *pMsg, size_t length, uint8_t hash[IOTEX_HASH_SIZE]) |
| Get the Ethereum Message hash. More...
|
|
void | getPublicKey (const uint8_t privateKey[IOTEX_PRIVATE_KEY_SIZE], uint8_t publicKey[IOTEX_PUBLIC_KEY_SIZE]) |
| Get the public key from the private key. More...
|
|
ResultCode | signHash (const uint8_t hash[IOTEX_HASH_SIZE], const uint8_t private_key[IOTEX_PRIVATE_KEY_SIZE], uint8_t signature[IOTEX_SIGNATURE_SIZE]) |
| Sign a hash. More...
|
|
void | signMessage (const uint8_t *message, size_t size, const uint8_t privateKey[IOTEX_PRIVATE_KEY_SIZE], uint8_t signature[IOTEX_SIGNATURE_SIZE]) |
| Sign an ethereum message. More...
|
|
ResultCode | hex2str (const uint8_t *hex, size_t hex_size, char *str, size_t str_size) |
| Convert a byte array to a hex string. More...
|
|
ResultCode | str2hex (const char *str, uint8_t *hex, size_t size, size_t strLength=0) |
| Convert a hex string to a byte array. More...
|
|
◆ getEthereumMessageHash()
void Signer::getEthereumMessageHash |
( |
const uint8_t * |
pMsg, |
|
|
size_t |
length, |
|
|
uint8_t |
hash[IOTEX_HASH_SIZE] |
|
) |
| |
Get the Ethereum Message hash.
- Parameters
-
pMsg | A pointer to a byte array containing the message to hash |
length | The length of the message in bytes |
hash | The generated hash |
◆ getHash()
void Signer::getHash |
( |
const uint8_t * |
pData, |
|
|
size_t |
size, |
|
|
uint8_t |
hash[IOTEX_HASH_SIZE] |
|
) |
| |
Get the kekkac 256 hash.
- Parameters
-
| pData | A pointer to a byte array containing the data to hash |
| size | The size of the data in bytes |
[out] | hash | The generated hash |
◆ getPublicKey()
void Signer::getPublicKey |
( |
const uint8_t |
privateKey[IOTEX_PRIVATE_KEY_SIZE], |
|
|
uint8_t |
publicKey[IOTEX_PUBLIC_KEY_SIZE] |
|
) |
| |
Get the public key from the private key.
- Parameters
-
| privateKey | |
[out] | publicKey | |
◆ hex2str()
ResultCode Signer::hex2str |
( |
const uint8_t * |
hex, |
|
|
size_t |
hex_size, |
|
|
char * |
str, |
|
|
size_t |
str_size |
|
) |
| |
Convert a byte array to a hex string.
- Parameters
-
| hex | A pointer to the array |
| hex_size | The array size |
[out] | str | A pointer to a buffer where to store the hex string |
| str_size | The size of the hex string buffer |
- Returns
- ResultCode Success or an error code
◆ signHash()
ResultCode Signer::signHash |
( |
const uint8_t |
hash[IOTEX_HASH_SIZE], |
|
|
const uint8_t |
private_key[IOTEX_PRIVATE_KEY_SIZE], |
|
|
uint8_t |
signature[IOTEX_SIGNATURE_SIZE] |
|
) |
| |
Sign a hash.
- Parameters
-
| hash | The hash to sign |
| private_key | The private key to use for signing |
[out] | signature | The signature produced |
- Returns
- ResultCode Success or an error code
◆ signMessage()
void Signer::signMessage |
( |
const uint8_t * |
message, |
|
|
size_t |
size, |
|
|
const uint8_t |
privateKey[IOTEX_PRIVATE_KEY_SIZE], |
|
|
uint8_t |
signature[IOTEX_SIGNATURE_SIZE] |
|
) |
| |
Sign an ethereum message.
- Parameters
-
| message | A pointer to a byte array containing the message to sign |
| size | The size of the mesage |
| privateKey | The private key to use for signing |
[out] | signature | The signature produced |
◆ str2hex()
ResultCode Signer::str2hex |
( |
const char * |
str, |
|
|
uint8_t * |
hex, |
|
|
size_t |
size, |
|
|
size_t |
strLength = 0 |
|
) |
| |
Convert a hex string to a byte array.
- Parameters
-
| str | The hex string. Must be null terminated |
[out] | hex | A pointer to a buffer where to store the bytes |
| size | The size of the buffer |
| strLength[opt] | The string length, needs to be passed if str is not null terminated |
- Returns
- ResultCode Success or an error code
The documentation for this class was generated from the following files:
- src/signer/signer.h
- src/signer/signer.cpp