From 2cef5546e10b22396d4f747fa0812c00a2f7e23c Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Fri, 12 May 2023 11:54:13 -0400 Subject: [PATCH] paper over the unfortunate half-complete key transition --- test/Generators.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/Generators.hs b/test/Generators.hs index b43ea31..be8e2b7 100644 --- a/test/Generators.hs +++ b/test/Generators.hs @@ -16,8 +16,8 @@ import Hedgehog (MonadGen) import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range import Tahoe.CHK.Merkle (MerkleTree (..), makeTreePartial) -import Tahoe.SDMF (KeyPair (..), Share (..), toPublicKey) -import Tahoe.SDMF.Internal.Share (HashChain (HashChain), SDMF_IV (SDMF_IV)) +import Tahoe.SDMF (Share (..)) +import Tahoe.SDMF.Internal.Share (HashChain (HashChain), SDMF_IV (..)) rootHashLength :: Int rootHashLength = 32 @@ -28,6 +28,10 @@ ivLength = 16 signatureLength :: Range.Range Int signatureLength = Range.linear 250 260 +newtype KeyPair = KeyPair RSA.PrivateKey +toPrivateKey (KeyPair privKey) = privKey +toPublicKey = RSA.private_pub . toPrivateKey + {- | Generate SDMF shares. The contents of the share are not necessarily semantically valid. -} -- GitLab