-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!: improve wallet key derivation by use of proper domain separation (see issue #4170) #4316
Merged
stringhandler
merged 23 commits into
tari-project:development
from
jorgeantonio21:ja-wallet-key-derivation
Aug 2, 2022
+344
−429
Merged
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
55cc605
add domain separation for derive_key method. This is done by using th…
jorgeantonio21 8644cf9
refactor domain separation and add comments
jorgeantonio21 d5e2da2
run cargo fmt
jorgeantonio21 1c4e155
add length extension attack resistant trait to key manager D subtype
jorgeantonio21 59d0e70
wasm refactor
jorgeantonio21 4f65dde
review PR suggestions and comments
jorgeantonio21 cef7504
check unit tests
jorgeantonio21 9ff553b
add changes
jorgeantonio21 4192b4e
add tari common types to Cargo.toml
jorgeantonio21 be59d1e
add tari-crypto public key imports
jorgeantonio21 2aad07b
revert version
jorgeantonio21 16e638d
refactor wasm test
jorgeantonio21 a9a2349
add new hashing api support
jorgeantonio21 946a02e
refactor cargo toml
jorgeantonio21 27bcb7e
support hashing api
jorgeantonio21 f77787b
run cargo fmt
jorgeantonio21 67d6b50
comments to PR
jorgeantonio21 2cb74c2
remove duplicates
jorgeantonio21 a0f3da4
merge development
jorgeantonio21 bf306c3
merge development and refactor use of hashing API
jorgeantonio21 3721b8d
refactor further tests
jorgeantonio21 a76b387
merge development
jorgeantonio21 f93c4df
merge branch development
jorgeantonio21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -11,3 +11,25 @@ pub mod mnemonic_wordlists; | |||||
#[allow(clippy::unused_unit)] | ||||||
#[cfg(feature = "wasm")] | ||||||
pub mod wasm; | ||||||
|
||||||
use tari_common::hashing_domain::*; | ||||||
|
||||||
/// The key manager domain separated hashing domain | ||||||
/// Usage: | ||||||
/// let hash = comms_dht_hash_domain().digest::<Blake256>(b"my secret"); | ||||||
/// etc. | ||||||
pub fn base_layer_key_manager_mac_generation() -> HashingDomain { | ||||||
HashingDomain::new("base_layer.key_manager.cipher_seed.mac_generation") | ||||||
} | ||||||
|
||||||
pub fn base_layer_key_manager_argon2_encoding() -> HashingDomain { | ||||||
HashingDomain::new("base_layer.key_manager.cipher_seed.argon2_encoding") | ||||||
} | ||||||
|
||||||
pub fn base_layer_key_manager_chacha20_encoding() -> HashingDomain { | ||||||
HashingDomain::new("base_layer.key_manager.cipher_seed.chacha20_encoding") | ||||||
} | ||||||
|
||||||
pub fn base_layer_key_manager() -> HashingDomain { | ||||||
HashingDomain::new("base_layer.key_manager.key_manager") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see these functions are not being used in this PR; I suppose they were created for use elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, used in #4296.