1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-03 12:00:59 +00:00

nem: Add nem_network_name

This commit is contained in:
Saleem Rashid 2017-05-31 13:03:39 +01:00 committed by Pavol Rusnak
parent 501c778812
commit fd0952621e
2 changed files with 15 additions and 0 deletions

13
nem.c
View File

@ -30,6 +30,19 @@
#include "ripemd160.h"
#include "sha3.h"
const char *nem_network_name(uint8_t network) {
switch (network) {
case NEM_NETWORK_MAINNET:
return "NEM Mainnet";
case NEM_NETWORK_TESTNET:
return "NEM Testnet";
case NEM_NETWORK_MIJIN:
return "Mijin";
default:
return NULL;
}
}
void nem_get_address_raw(const ed25519_public_key public_key, uint8_t version, uint8_t *address) {
uint8_t hash[SHA3_256_DIGEST_LENGTH];

2
nem.h
View File

@ -33,6 +33,8 @@
#define NEM_ADDRESS_SIZE 40
#define NEM_ADDRESS_SIZE_RAW 25
const char *nem_network_name(uint8_t network);
void nem_get_address_raw(const ed25519_public_key public_key, uint8_t version, uint8_t *address);
bool nem_get_address(const ed25519_public_key public_key, uint8_t version, char *address);