forked from remusao/hcryptopals
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
26 additions
and
10 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
module Crypto.Pals.Xor where | ||
|
||
import qualified Data.Bits as Bits | ||
import qualified Data.ByteString.Lazy as B | ||
|
||
xor :: B.ByteString -> B.ByteString -> Maybe B.ByteString | ||
xor bs1 bs2 | ||
| B.length bs1 /= B.length bs2 = Nothing | ||
| otherwise = Just . B.pack . B.zipWith Bits.xor bs1 $ bs2 |
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
module Lib | ||
( module Crypto.Pals.Encoding | ||
, module Crypto.Pals.BitStream | ||
, module Crypto.Pals.Xor | ||
) where | ||
|
||
import Crypto.Pals.Encoding | ||
import Crypto.Pals.BitStream | ||
import Crypto.Pals.Xor |
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