Skip to content

Commit

Permalink
feat: support passphrase and slip39 to zcash
Browse files Browse the repository at this point in the history
  • Loading branch information
soralit committed Dec 18, 2024
1 parent 1a8bc53 commit bed660d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/managers/account_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,10 @@ int32_t CalculateZcashUFVK(uint8_t accountIndex, const char* password) {
ASSERT(accountIndex <= 2);

uint8_t seed[SEED_LEN];
int len = GetMnemonicType() == MNEMONIC_TYPE_BIP39 ? sizeof(seed) : GetCurrentAccountEntropyLen();
int32_t ret = GetAccountSeed(accountIndex, &seed, password);

SimpleResponse_c_char *response = derive_zcash_ufvk(seed, SEED_LEN);
SimpleResponse_c_char *response = derive_zcash_ufvk(seed, len);
if (response->error_code != 0)
{
ret = response->error_code;
Expand All @@ -598,7 +599,7 @@ int32_t CalculateZcashUFVK(uint8_t accountIndex, const char* password) {
strcpy_s(ufvk, ZCASH_UFVK_MAX_LEN, response->data);
free_simple_response_c_char(response);

SimpleResponse_u8 *responseSFP = calculate_zcash_seed_fingerprint(seed, SEED_LEN);
SimpleResponse_u8 *responseSFP = calculate_zcash_seed_fingerprint(seed, len);
if (responseSFP->error_code != 0)
{
ret = response->error_code;
Expand Down

0 comments on commit bed660d

Please sign in to comment.