-
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
feat: remove hashing domain and update key manager #4367
feat: remove hashing domain and update key manager #4367
Conversation
84ceff5
to
6e4cfa9
Compare
b0450f4
to
b8a8f2d
Compare
- Removed hashing domain in favour of recent changes in `tari_crypto "v0.15.3"`. - Added a specialized marker trait for tight coupling of `DomainSeparatedHasher` to `Digest`; this is useful when a low level hashing function that accepts `Digest` as type needs to guarantee that domain separated hashing is implemented. - Added a MAC domain hasher that guarantees implementation of `DomainSeparatedHasher` and `LengthExtensionAttackResistant`. - Upadated the key manager to use the MAC domain hasher and to implement the `LengthExtensionAttackResistant` trait.
b8a8f2d
to
6c680dd
Compare
DomainSeparatedHasher::<Blake256, KeyManagerHashDomain>::new("cipher_seed.chacha20_encoding") | ||
} | ||
hash_domain!( | ||
KeyManagerMacGeneration, |
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.
KeyManagerMacGeneration, | |
KeyManagerMacGenerationDomain, |
1 | ||
); | ||
hash_domain!( | ||
KeyManagerArgon2Encoding, |
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.
KeyManagerArgon2Encoding, | |
KeyManagerArgon2EncodingDomain, |
1 | ||
); | ||
hash_domain!( | ||
KeyManagerChacha20Encoding, |
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.
KeyManagerChacha20Encoding, | |
KeyManagerChacha20EncodingDomain, |
@@ -495,7 +503,7 @@ async fn test_utxo_selection_no_chain_metadata() { | |||
|
|||
// test if a fee estimate would be possible with pending funds included | |||
// at this point 52000 uT is still spendable, with pending change incoming of 1690 uT | |||
// so instead of returning "not enough funds", return "funds pending" | |||
// so instead of returning "not enough funds".to_string(), return "funds pending" |
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.
weird, but ok
Description
tari_crypto "v0.15.3"
.DomainSeparatedHasher
toDigest
; this is useful when a low level hashing function that acceptsDigest
as type needs to guarantee that domain separated hashing is implemented.DomainSeparatedHasher
andLengthExtensionAttackResistant
.LengthExtensionAttackResistant
trait.Motivation and Context
See above
How Has This Been Tested?
Passed unit tests
Passed cucumber tests