Skip to content

Commit

Permalink
replace bin2hex
Browse files Browse the repository at this point in the history
  • Loading branch information
chris124567 committed Jan 19, 2024
1 parent 8c5b071 commit 530cc21
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/sia.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <os_seed.h>
#include <stdbool.h>
#include <stdint.h>
#include <format.h>
#include <string.h>

#include "blake2b.h"
Expand Down Expand Up @@ -64,12 +65,7 @@ void deriveAndSign(uint8_t *dst, uint32_t index, const uint8_t *hash) {
}

void bin2hex(char *dst, const uint8_t *data, uint64_t inlen) {
static uint8_t const hex[] = "0123456789abcdef";
for (uint64_t i = 0; i < inlen; i++) {
dst[2 * i + 0] = hex[(data[i] >> 4) & 0x0F];
dst[2 * i + 1] = hex[(data[i] >> 0) & 0x0F];
}
dst[2 * inlen] = '\0';
format_hex(data, inlen, dst, inlen * 2 + 1);
}

void pubkeyToSiaAddress(char *dst, const uint8_t publicKey[static 65]) {
Expand Down

0 comments on commit 530cc21

Please sign in to comment.