Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-exports some types used in the modules interfaces #23

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions one-time-password.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ test-suite tests
, base32 ^>=0.4
, bytestring
, chronos
, cryptonite
, crypton
, one-time-password
, sel
, tasty
Expand Down Expand Up @@ -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
6 changes: 5 additions & 1 deletion src/OTP/HOTP.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module OTP.HOTP
( OTP
( OTP (..)

-- ** HMAC-SHA-1
, newSHA1Key
Expand All @@ -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
Expand Down
14 changes: 11 additions & 3 deletions src/OTP/TOTP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
module OTP.TOTP
( -- ** Usage
-- $usage
OTP
OTP (..)

-- ** HMAC-SHA-1
, newSHA1Key
Expand All @@ -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)
Expand All @@ -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
)
Expand Down
1 change: 0 additions & 1 deletion test/Test/HOTP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading