Skip to content

Commit

Permalink
Use CC.encryptedCreateDirectWithoutTweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Anviking committed Feb 24, 2020
1 parent 5f4d255 commit 3858dbb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/core/src/Cardano/Wallet/Primitive/AddressDerivation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -772,12 +772,13 @@ data ErrXPrvFromStrippedPubXPrv
xPrvFromStrippedPubXPrv :: ByteString -> Either ErrXPrvFromStrippedPubXPrv XPrv
xPrvFromStrippedPubXPrv x =
let
res = toXPrv $ CC.encryptedCreateDirectWithTweak x pass
res = toXPrv $ CC.encryptedCreateDirectWithoutTweak prv cc pass
in
if BS.length x == expectedInputLength
then res
else Left $ ErrInputLengthMismatch expectedInputLength (BS.length x)
where
(prv, cc) = BS.splitAt 64 x
pass :: ByteString
pass = ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,8 @@ prop_unXPrvStripRoundtrip (XPrvWithPass k enc) = do
Left ErrNoRoundtripMismatch ->
enc /= Passphrase ""
& label "mismatch"
& counterexample "XPrv should be encrypted for the roundtrip to\
\fail"
Left ErrUnexpectedRoundtripError ->
& counterexample "XPrv should be encrypted for the roundtrip to fail"
Left (ErrUnexpectedRoundtripError) ->
counterexample "unexpected error" $ property False

prop_xPrvFromStrippedPubXPrvLengthRequirement
Expand Down
4 changes: 2 additions & 2 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ extra-deps:
- persistent-template

# cardano-crypto
- git: https://github.com/input-output-hk/cardano-crypto
commit: 3c5db489c71a4d70ee43f5f9b979fcde3c797f2a
- git: https://github.com/Anviking/cardano-crypto
commit: a6c3bfe12290cf4f6ac47836a1acb3d417da9d96

# iohk-monitoring-framework
- git: https://github.com/input-output-hk/iohk-monitoring-framework
Expand Down

0 comments on commit 3858dbb

Please sign in to comment.