cryptopals

Matasano's cryptopals challenges (cryptopals.com).
Log | Files | Refs | README | LICENSE

commit 28d78912500b58309199ad07aa216081a23e97c7
parent 2d643548cb4b67baa46d316eaef0df5e14b292b5
Author: Jared Tobin <jared@jtobin.io>
Date:   Sun, 30 Jul 2023 12:01:56 -0230

Fix some bit rot in the executables.

Diffstat:
Msrc/AES.hs | 2+-
Msrc/Pkcs7.hs | 10+++-------
2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/AES.hs b/src/AES.hs @@ -104,7 +104,7 @@ aes Args {..} = do SE.exitFailure Right iv -> - out $ AES.decryptCbcAES128 iv k v + out $ AES.decryptCbcAES128 k v main :: IO () main = do diff --git a/src/Pkcs7.hs b/src/Pkcs7.hs @@ -8,7 +8,6 @@ import qualified Data.Text as T import qualified Data.Text.IO as TIO import qualified Data.Text.Encoding as TE import qualified Options.Applicative as O -import qualified System.Exit as SE import qualified System.IO as SIO data Args = Args { @@ -22,12 +21,9 @@ ops = Args <*> O.argument O.str (O.metavar "INPUT") pkcs :: Args -> IO () -pkcs Args {..} = case CU.pkcs7 argsPad (TE.encodeUtf8 argsInp) of - Nothing -> do - TIO.hPutStrLn SIO.stderr ("cryptopals: invalid padding target") - SE.exitFailure - - Just b -> TIO.putStr . TE.decodeUtf8 $ b +pkcs Args {..} = do + let b = CU.pkcs7 argsPad (TE.encodeUtf8 argsInp) + TIO.putStr . TE.decodeUtf8 $ b main :: IO () main = do