Skip to content

Fix initial version of cardano-crypto-wallet#667

Draft
lehins wants to merge 36 commits into
masterfrom
lehins/fix-cardano-crypto-wallet
Draft

Fix initial version of cardano-crypto-wallet#667
lehins wants to merge 36 commits into
masterfrom
lehins/fix-cardano-crypto-wallet

Conversation

@lehins

@lehins lehins commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Description

This is a PR that fixes initial version that was added in #653 and reverts #666

This PR is mostly ready. I just need to tidy up git history, self-review the PR and provide a better description for this PR with important changes that are applied to the initial version. Other than that it is ready for review

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages.
    New section is never added with the code changes. (See RELEASING.md)
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated.
    If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • Self-reviewed the diff

@lehins lehins force-pushed the lehins/fix-cardano-crypto-wallet branch from 10741b8 to 610e241 Compare June 4, 2026 15:44
@lehins lehins requested review from disassembler and perturbing June 4, 2026 16:36
@lehins lehins force-pushed the lehins/fix-cardano-crypto-wallet branch from 610e241 to 67a55ab Compare June 29, 2026 12:19
lehins added 26 commits July 4, 2026 08:59
This properly fixes scoping and async exception handling for decrypting
`KeyMaterial`

Also rename `encryptedChangePass` -> `encryptedChangePassphrase` for
consistency with `encryptedValidatePassphrase`
Also introduce a more descriptive `mkEncryptedKey` function that
deprecates `encryptedKey`
Extracting `SecretKey` construction outside, makes resource allocation
in `bracket` much cheaper, which is absolutely what we want for proper async
exception handling
* `ekey` -> `skey`
* `ENCRYPTED_KEY_SIZE` -> `UNENCRYPTED_KEY_SIZE`

It was incorrectly named, since secret key in that structure is not encrypted
There was a totally unnecessary allocation of key material legacy struct
Also rename `encrypted_key` -> `key_material`

f
There was need to make a copy of the full `KeyMaterial` into MLocked
memory, which is scarce, just to validate public key against a secret key
@lehins lehins force-pushed the lehins/fix-cardano-crypto-wallet branch from 67a55ab to 19f6bf6 Compare July 4, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant