diff --git a/app/Main.hs b/app/Main.hs index 5306475..5762e3d 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -2,19 +2,19 @@ module Main (main) where import Chronos (Time (..), Timespan (..), datetimeToTime, decode_YmdHMS, now, second, w3c) import Data.ByteString (StrictByteString) -import qualified Data.ByteString.Char8 as BSC8 +import Data.ByteString.Char8 qualified as BSC8 import Data.Maybe (fromJust) import Data.Text (Text) import Data.Text.Display -import qualified Data.Text.Encoding as TE -import qualified Data.Text.IO as TIO +import Data.Text.Encoding qualified as TE +import Data.Text.IO qualified as TIO import Data.Version (showVersion) import Data.Word import Options.Applicative import Paths_one_time_password (version) import Sel (secureMain) -import qualified Sel.HMAC.SHA256 as SHA256 -import qualified Sel.HMAC.SHA512 as SHA512 +import Sel.HMAC.SHA256 qualified as SHA256 +import Sel.HMAC.SHA512 qualified as SHA512 import System.Exit (exitFailure) import Torsor (scale) diff --git a/one-time-password.cabal b/one-time-password.cabal index 9474984..b98599b 100644 --- a/one-time-password.cabal +++ b/one-time-password.cabal @@ -79,7 +79,7 @@ test-suite tests , base32 ^>=0.4 , bytestring , chronos - , cryptonite + , crypton , one-time-password , sel , tasty @@ -127,5 +127,5 @@ executable one-time-password , torsor ^>=0.1 other-modules: Paths_one_time_password - autogen-modules: Paths_one_time_password + autogen-modules: Paths_one_time_password ghc-options: -Wall diff --git a/src/OTP/HOTP.hs b/src/OTP/HOTP.hs index 2ea787c..9cd8ddf 100644 --- a/src/OTP/HOTP.hs +++ b/src/OTP/HOTP.hs @@ -1,5 +1,5 @@ module OTP.HOTP - ( OTP + ( OTP (..) -- ** HMAC-SHA-1 , newSHA1Key @@ -15,6 +15,10 @@ module OTP.HOTP , newSHA512Key , hotpSHA512 , hotpSHA512Check + + -- ** Re-exports from OTP.Commons + , Digits + , mkDigits ) where import Crypto.Hash.SHA1 qualified as SHA1 diff --git a/src/OTP/TOTP.hs b/src/OTP/TOTP.hs index 96890c0..a64d58e 100644 --- a/src/OTP/TOTP.hs +++ b/src/OTP/TOTP.hs @@ -6,7 +6,7 @@ module OTP.TOTP ( -- ** Usage -- $usage - OTP + OTP (..) -- ** HMAC-SHA-1 , newSHA1Key @@ -25,6 +25,12 @@ module OTP.TOTP -- ** URI Generation , totpToURI + + -- ** Re-exports from OTP.Commons + , Algorithm (..) + , Digits + , digitsToWord32 + , mkDigits ) where import Chronos (Time (..), Timespan (..), asSeconds) @@ -37,9 +43,11 @@ import Sel.HMAC.SHA256 qualified as SHA256 import Sel.HMAC.SHA512 qualified as SHA512 import OTP.Commons - ( Algorithm + ( Algorithm (..) , Digits - , OTP + , OTP (..) + , digitsToWord32 + , mkDigits , totpCounter , totpCounterRange ) diff --git a/test/Test/HOTP.hs b/test/Test/HOTP.hs index 37f64d6..03eeba6 100644 --- a/test/Test/HOTP.hs +++ b/test/Test/HOTP.hs @@ -9,7 +9,6 @@ import Sel.HMAC.SHA256 qualified as SHA256 import Sel.HMAC.SHA512 qualified as SHA512 import Data.Text qualified as Text -import OTP.Commons import Test.Tasty import Test.Tasty.HUnit import Test.Utils