diff --git a/CHANGELOG.md b/CHANGELOG.md index be4549e0..6abdaadc 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Change log +## [1.5.3] - 2023-11-16 +### Added +- + +### Changed +- + +### Fixed +- Fixed CodeQL warnings about sign check of a bitwise operation + ## [1.5.2] - 2023-11-15 ### Added - @@ -10,7 +20,6 @@ - Tidied up code that sets 'Processing' screen on Nano S devices - Changed all Variable Length Arrays to a defined length - ### Fixed - Fix freezing at 'Processing' screen on Nano S devices diff --git a/Makefile b/Makefile index 33e01424..20d87984 100755 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ all: default APPNAME = "Seed Tool" APPVERSION_M = 1 APPVERSION_N = 5 -APPVERSION_P = 2 +APPVERSION_P = 3 APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" APP_LOAD_PARAMS = --appFlags 0x10 $(COMMON_LOAD_PARAMS) --curve secp256k1 --path "" diff --git a/README.md b/README.md index 6595e9c6..b78b6b7f 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,10 @@ The application uses [Sharded Secret Key Reconstruction (SSKR)](https://github.c For more information about SSKR, see [SSKR for Users](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/sskr-users.md). > [!NOTE] -> Generated Shamir's Secret Shares may be cheaply and safely backed up to a steel wallet using the method described [here](https://blockmit.com/english/guides/diy/make-cold-wallet-washers/) or [here](https://jlopp.github.io/metal-bitcoin-storage-reviews/reviews/safu-ninja/). This will keep your backup safe in event of fire, flood or natural disaster. +> SSKR is non-deterministic. There is a random factor introduced when the shares are created, which means that every time you generate shares they will be different. This is an expected and correct result. + +> [!TIP] +> Generated Shamir's Secret Shares may be cheaply and safely backed up to a steel wallet using the methods described [here](https://blockmit.com/english/guides/diy/make-cold-wallet-washers/), [here](https://jlopp.github.io/metal-bitcoin-storage-reviews/reviews/safu-ninja/) or [here](https://github.com/BlockchainCommons/crypto-commons/blob/master/Docs/sskr-cold-storage.md). This will keep your backup safe in event of fire, flood or natural disaster. ## Check Shamir's secret shares The Ledger application also provides an option to confirm the onboarded seed against SSKR shares. diff --git a/src/bc-sskr/sskr.c b/src/bc-sskr/sskr.c index c42a66dd..97e45136 100644 --- a/src/bc-sskr/sskr.c +++ b/src/bc-sskr/sskr.c @@ -376,8 +376,8 @@ static int16_t combine_shards_internal( // here, all of the shards are unpacked into member groups. Now we go through each // group and recover the group secret, and then use the result to recover the // master secret - uint8_t gx[SHAMIR_MAX_SHARE_COUNT]; - const uint8_t *gy[SHAMIR_MAX_SHARE_COUNT]; + uint8_t gx[SSKR_MAX_GROUP_COUNT]; + const uint8_t *gy[SSKR_MAX_GROUP_COUNT]; // allocate enough space for the group shards and the encrypted master secret uint8_t group_shares[SSKR_MAX_STRENGTH_BYTES * (SSKR_MAX_GROUP_COUNT + 1)]; diff --git a/src/ux_common/onboarding_seed_bip39.c b/src/ux_common/onboarding_seed_bip39.c index 6b51441d..3313c2a4 100644 --- a/src/ux_common/onboarding_seed_bip39.c +++ b/src/ux_common/onboarding_seed_bip39.c @@ -153,7 +153,7 @@ unsigned int bolos_ux_bip39_mnemonic_encode(const uint8_t* seed, idx = 0; for (j = 0; j < 11; j++) { idx <<= 1; - idx += (bits[(i * 11 + j) / 8] & (1 << (7 - ((i * 11 + j) % 8)))) > 0; + idx += (bits[(i * 11 + j) / 8] & (1 << (7 - ((i * 11 + j) % 8)))) != 0; } word_len = BIP39_WORDLIST_OFFSETS[idx + 1] - BIP39_WORDLIST_OFFSETS[idx]; if ((offset + word_len) > out_len) { diff --git a/src/ux_common/onboarding_seed_sskr.c b/src/ux_common/onboarding_seed_sskr.c index 81eca6d6..0544733a 100644 --- a/src/ux_common/onboarding_seed_sskr.c +++ b/src/ux_common/onboarding_seed_sskr.c @@ -141,8 +141,7 @@ unsigned int bolos_ux_sskr_mnemonic_encode(unsigned char *input, for (uint8_t i = 0; i < (uint8_t) input_len; i++) { offset = SSKR_MNEMONIC_LENGTH * input[i]; - if ((position + SSKR_MNEMONIC_LENGTH <= output_len) && - (offset <= SSKR_WORDLIST_LENGTH - SSKR_MNEMONIC_LENGTH)) { + if (position + SSKR_MNEMONIC_LENGTH <= output_len) { memcpy(output + position, SSKR_WORDLIST + offset, SSKR_MNEMONIC_LENGTH); } else { memzero(output, sizeof(output));