diff --git a/lib/secrets/src/Cardano/Wallet/Primitive/Passphrase.hs b/lib/secrets/src/Cardano/Wallet/Primitive/Passphrase.hs index 112de67d394..2276b426df6 100644 --- a/lib/secrets/src/Cardano/Wallet/Primitive/Passphrase.hs +++ b/lib/secrets/src/Cardano/Wallet/Primitive/Passphrase.hs @@ -74,10 +74,10 @@ checkPassphrase -> Either ErrWrongPassphrase () checkPassphrase scheme received stored = case scheme of EncryptWithPBKDF2 -> PBKDF2.checkPassphrase prepared stored - EncryptWithScrypt -> case Scrypt.checkPassphrase prepared stored of - Just True -> Right () - Just False -> Left ErrWrongPassphrase - Nothing -> Left (ErrPassphraseSchemeUnsupported scheme) + EncryptWithScrypt -> + if Scrypt.checkPassphrase prepared stored + then Right () + else Left ErrWrongPassphrase where prepared = preparePassphrase scheme received diff --git a/lib/secrets/src/Cardano/Wallet/Primitive/Passphrase/Legacy.hs b/lib/secrets/src/Cardano/Wallet/Primitive/Passphrase/Legacy.hs index 110d8110324..664c85a8ff4 100644 --- a/lib/secrets/src/Cardano/Wallet/Primitive/Passphrase/Legacy.hs +++ b/lib/secrets/src/Cardano/Wallet/Primitive/Passphrase/Legacy.hs @@ -112,13 +112,8 @@ hashed passphrases that were created with `scrypt`. ------------------------------------------------------------------------------} -- | Verify a wallet spending password using the legacy Byron scrypt encryption -- scheme. -checkPassphrase :: Passphrase "encryption" -> PassphraseHash -> Maybe Bool -#if HAVE_SCRYPT -checkPassphrase pwd stored = Just $ checkPassphraseScrypt pwd stored -#else --- Stub function for when compiled without @scrypt@. -checkPassphrase _ _ = Nothing -#endif +checkPassphrase :: Passphrase "encryption" -> PassphraseHash -> Bool +checkPassphrase = checkPassphraseCryptonite -- | Encrypt a wallet spending password using -- the legacy Byron scrypt encryption scheme.