Skip to content

Commit

Permalink
Remove redundant flag
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPxt committed Oct 31, 2024
1 parent f2e7976 commit 5b3699a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/src/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ zxerr_t crypto_sign(uint8_t *signature, uint16_t signatureMaxlen, const uint8_t

zxerr_t crypto_fillAddress(uint8_t *buffer, uint16_t bufferLen, uint16_t *addrResponseLen) {
static uint8_t address[65];
static uint8_t is_computed = 0;
static uint32_t last_hdPath[HDPATH_LEN_DEFAULT] = {0};

if (buffer == NULL || addrResponseLen == NULL) {
Expand All @@ -117,9 +116,8 @@ zxerr_t crypto_fillAddress(uint8_t *buffer, uint16_t bufferLen, uint16_t *addrRe

*addrResponseLen = 0;

if (!is_computed || MEMCMP(last_hdPath, hdPath, sizeof(uint32_t) * HDPATH_LEN_DEFAULT) != 0) {
if (MEMCMP(last_hdPath, hdPath, sizeof(uint32_t) * HDPATH_LEN_DEFAULT) != 0) {
CHECK_ZXERR(crypto_extractPublicKey(address, sizeof(address)))
is_computed = 1;
}

MEMCPY(buffer, address, PUB_KEY_LENGTH);
Expand Down

0 comments on commit 5b3699a

Please sign in to comment.