Skip to content

Commit

Permalink
Fix type applications
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact committed Nov 29, 2021
1 parent 22171f4 commit 3b484e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cardano-crypto-class/src/Cardano/Crypto/KES/Mock.hs
Expand Up @@ -88,7 +88,7 @@ instance KnownNat t => KESAlgorithm (MockKES t) where

updateKES () (SignKeyMockKES vk t') t =
assert (t == t') $
if t+1 < totalPeriodsKES (Proxy @ (MockKES t))
if t+1 < totalPeriodsKES (Proxy @(MockKES t))
then Just (SignKeyMockKES vk (t+1))
else Nothing

Expand All @@ -108,7 +108,7 @@ instance KnownNat t => KESAlgorithm (MockKES t) where
| otherwise
= Left "KES verification failed"

totalPeriodsKES _ = fromIntegral (natVal (Proxy @ t))
totalPeriodsKES _ = fromIntegral (natVal (Proxy @t))


--
Expand Down
12 changes: 6 additions & 6 deletions cardano-crypto-class/src/Cardano/Crypto/KES/Simple.hs
Expand Up @@ -112,10 +112,10 @@ instance (DSIGNAlgorithm d, Typeable d, KnownNat t, KnownNat (SeedSizeDSIGN d *
Just vk -> verifyDSIGN ctxt vk a sig

updateKES _ sk t
| t+1 < fromIntegral (natVal (Proxy @ t)) = Just sk
| t+1 < fromIntegral (natVal (Proxy @t)) = Just sk
| otherwise = Nothing

totalPeriodsKES _ = fromIntegral (natVal (Proxy @ t))
totalPeriodsKES _ = fromIntegral (natVal (Proxy @t))


--
Expand All @@ -124,12 +124,12 @@ instance (DSIGNAlgorithm d, Typeable d, KnownNat t, KnownNat (SeedSizeDSIGN d *

seedSizeKES _ =
let seedSize = seedSizeDSIGN (Proxy :: Proxy d)
duration = fromIntegral (natVal (Proxy @ t))
duration = fromIntegral (natVal (Proxy @t))
in duration * seedSize

genKeyKES seed =
let seedSize = seedSizeDSIGN (Proxy :: Proxy d)
duration = fromIntegral (natVal (Proxy @ t))
duration = fromIntegral (natVal (Proxy @t))
seeds = take duration
. map mkSeedFromBytes
$ unfoldr (getBytesFromSeed seedSize) seed
Expand All @@ -143,11 +143,11 @@ instance (DSIGNAlgorithm d, Typeable d, KnownNat t, KnownNat (SeedSizeDSIGN d *

sizeVerKeyKES _ = sizeVerKeyDSIGN (Proxy :: Proxy d) * duration
where
duration = fromIntegral (natVal (Proxy @ t))
duration = fromIntegral (natVal (Proxy @t))

sizeSignKeyKES _ = sizeSignKeyDSIGN (Proxy :: Proxy d) * duration
where
duration = fromIntegral (natVal (Proxy @ t))
duration = fromIntegral (natVal (Proxy @t))

sizeSigKES _ = sizeSigDSIGN (Proxy :: Proxy d)

Expand Down

0 comments on commit 3b484e8

Please sign in to comment.