Skip to content
Merged
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
2 changes: 2 additions & 0 deletions cardano-crypto-class/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 2.5.0.0

* Add `NFData` superclass constraints for the `VerKeyVRF`, `SignKeyVRF`,
and `CertVRF` associated types in `VRFAlgorithm`.
* Remove constructors of `BLS12381SignContext` from export; use `minSigPoPDST` or `minVerKeyPoPDST` for the standard PoP ciphersuites.

## 2.4.0.0
Expand Down
3 changes: 3 additions & 0 deletions cardano-crypto-class/src/Cardano/Crypto/VRF/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,12 @@ class
( Typeable v
, Show (VerKeyVRF v)
, Eq (VerKeyVRF v)
, NFData (VerKeyVRF v)
, Show (SignKeyVRF v)
, NFData (SignKeyVRF v)
, Show (CertVRF v)
, Eq (CertVRF v)
, NFData (CertVRF v)
, NoThunks (CertVRF v)
, NoThunks (VerKeyVRF v)
, NoThunks (SignKeyVRF v)
Expand Down
7 changes: 4 additions & 3 deletions cardano-crypto-class/src/Cardano/Crypto/VRF/Mock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Cardano.Crypto.VRF.Mock (
)
where

import Control.DeepSeq (NFData)
import Data.Proxy (Proxy (..))
import Data.Word (Word64)
import GHC.Generics (Generic)
Expand All @@ -33,13 +34,13 @@ instance VRFAlgorithm MockVRF where
--

newtype VerKeyVRF MockVRF = VerKeyMockVRF Word64
deriving (Show, Eq, Ord, Generic, NoThunks)
deriving (Show, Eq, Ord, Generic, NoThunks, NFData)

newtype SignKeyVRF MockVRF = SignKeyMockVRF Word64
deriving (Show, Eq, Ord, Generic, NoThunks)
deriving (Show, Eq, Ord, Generic, NoThunks, NFData)

newtype CertVRF MockVRF = CertMockVRF Word64
deriving (Show, Eq, Ord, Generic, NoThunks)
deriving (Show, Eq, Ord, Generic, NoThunks, NFData)

--
-- Metadata and basic key operations
Expand Down
10 changes: 10 additions & 0 deletions cardano-crypto-class/src/Cardano/Crypto/VRF/NeverUsed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module Cardano.Crypto.VRF.NeverUsed (
)
where

import Control.DeepSeq (NFData (..))
import GHC.Generics (Generic)
import NoThunks.Class (NoThunks)

Expand All @@ -22,6 +23,15 @@ import Cardano.Crypto.VRF.Class
-- trying to sign or verify something a runtime exception will be thrown.
data NeverVRF

instance NFData (VerKeyVRF NeverVRF) where
rnf x = x `seq` ()

instance NFData (SignKeyVRF NeverVRF) where
rnf x = x `seq` ()

instance NFData (CertVRF NeverVRF) where
rnf x = x `seq` ()

instance VRFAlgorithm NeverVRF where
data VerKeyVRF NeverVRF = NeverUsedVerKeyVRF
deriving (Show, Eq, Generic, NoThunks)
Expand Down
5 changes: 0 additions & 5 deletions cardano-crypto-praos/bench/Bench/Crypto/VRF.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ module Bench.Crypto.VRF (
import Data.ByteString (ByteString)
import Data.Proxy

import Control.DeepSeq

import Cardano.Crypto.VRF.Class
import Cardano.Crypto.VRF.Praos hiding (Seed)
import Cardano.Crypto.VRF.Simple
Expand All @@ -34,9 +32,6 @@ benchVRF ::
( VRFAlgorithm v
, ContextVRF v ~ ()
, Signable v ByteString
, NFData (CertVRF v)
, NFData (SignKeyVRF v)
, NFData (VerKeyVRF v)
) =>
proxy v ->
[Char] ->
Expand Down
1 change: 0 additions & 1 deletion cardano-crypto-praos/cardano-crypto-praos.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,5 @@ benchmark bench
cardano-crypto-class:{cardano-crypto-class, benchlib},
cardano-crypto-praos,
criterion,
deepseq,

ghc-options: -threaded
Loading