Skip to content

Commit

Permalink
Merge #160
Browse files Browse the repository at this point in the history
160: DSIGN key forgetting r=nc6 a=tdammers

Expose secure forgetting for the DSIGN implementation, and use it to securely forget the DSIGN part of the SignKeyKES of the SumKES and SingleKES implementations.

Should only be merged after #138.

Co-authored-by: Tobias Dammers <tdammers@gmail.com>
  • Loading branch information
iohk-bors[bot] and tdammers committed Oct 13, 2020
2 parents d1e122f + 4bff5d6 commit 8ce921f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cardano-crypto-class/src/Cardano/Crypto/KES/Single.hs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,8 @@ instance ( NaCl.SodiumDSIGNAlgorithm d -- needed for secure forgetting
--
-- forgetting
--

-- TODO: to implement this, we
-- should know how to forget DSIGN keys.
forgetSignKeyKES = const $ return ()
forgetSignKeyKES (SignKeySingleKES sk) =
NaCl.naclForgetSignKeyDSIGN (Proxy @d) sk

--
-- raw serialise/deserialise
Expand Down
1 change: 1 addition & 0 deletions cardano-crypto-class/src/Cardano/Crypto/Libsodium.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module Cardano.Crypto.Libsodium (
SodiumDSIGNAlgorithm (..),
naclSignDSIGN,
naclVerifyDSIGN,
naclForgetSignKeyDSIGN,
SodiumSignKeyDSIGN,
SodiumVerKeyDSIGN,
SodiumSigDSIGN,
Expand Down
8 changes: 8 additions & 0 deletions cardano-crypto-class/src/Cardano/Crypto/Libsodium/DSIGN.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Cardano.Crypto.Libsodium.DSIGN (
SodiumDSIGNAlgorithm (..),
naclSignDSIGN,
naclVerifyDSIGN,
naclForgetSignKeyDSIGN,
SodiumSignKeyDSIGN,
SodiumVerKeyDSIGN,
SodiumSigDSIGN,
Expand Down Expand Up @@ -63,6 +64,13 @@ class (DSIGNAlgorithm v, ContextDSIGN v ~ (), Signable v ~ SignableRepresentatio
-> SodiumSignKeyDSIGN v
-> SodiumVerKeyDSIGN v

naclForgetSignKeyDSIGN
:: Proxy v
-> SodiumSignKeyDSIGN v
-> IO ()
naclForgetSignKeyDSIGN _ (MLSB mfp) =
finalizeMLockedForeignPtr mfp

naclSignDSIGN
:: (SodiumDSIGNAlgorithm v, SignableRepresentation a)
=> Proxy v
Expand Down

0 comments on commit 8ce921f

Please sign in to comment.