Skip to content

Commit

Permalink
base58: use base58 encoding from ledger SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
spalmer25 committed Mar 4, 2024
1 parent 993358a commit bba3c8a
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 78 deletions.
1 change: 0 additions & 1 deletion src/apdu_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "apdu.h"
#include "baking_auth.h"
#include "base58_encoding.h"
#include "globals.h"
#include "keys.h"
#include "memory.h"
Expand Down
65 changes: 0 additions & 65 deletions src/base58_encoding.c

This file was deleted.

5 changes: 0 additions & 5 deletions src/base58_encoding.h

This file was deleted.

9 changes: 4 additions & 5 deletions src/to_string.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "to_string.h"

#include <base58.h>

#include "apdu.h"
#include "base58_encoding.h"
#include "keys.h"

#include <string.h>
Expand Down Expand Up @@ -107,8 +108,7 @@ void pkh_to_string(char *const buff,
memcpy(data.hash, hash, sizeof(data.hash));
compute_hash_checksum(data.checksum, &data, sizeof(data) - sizeof(data.checksum));

size_t out_size = buff_size;
if (!b58enc(buff, &out_size, &data, sizeof(data))) {
if (base58_encode((const uint8_t *) &data, sizeof(data), buff, buff_size) == -1) {
THROW(EXC_WRONG_LENGTH);
}
}
Expand All @@ -131,8 +131,7 @@ void chain_id_to_string(char *const buff, size_t const buff_size, chain_id_t con

compute_hash_checksum(data.checksum, &data, sizeof(data) - sizeof(data.checksum));

size_t out_size = buff_size;
if (!b58enc(buff, &out_size, &data, sizeof(data))) {
if (base58_encode((const uint8_t *) &data, sizeof(data), buff, buff_size) == -1) {
THROW(EXC_WRONG_LENGTH);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/ui_sign_bagl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "apdu.h"
#include "baking_auth.h"
#include "base58_encoding.h"
#include "globals.h"
#include "keys.h"
#include "memory.h"
Expand Down
1 change: 0 additions & 1 deletion src/ui_sign_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "apdu.h"
#include "baking_auth.h"
#include "base58_encoding.h"
#include "globals.h"
#include "keys.h"
#include "memory.h"
Expand Down

0 comments on commit bba3c8a

Please sign in to comment.