Skip to content
Snippets Groups Projects
Commit 743a2ee4 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

Generate parameters in-bounds for our ZFEC

parent 19b3e97c
Branches
No related tags found
1 merge request!7Implement enough encryption and encoding to be able to read plaintext from Tahoe-LAFS-generated SDMF shares
......@@ -100,6 +100,6 @@ shareHashChains = HashChain <$> Gen.list range element
-- | Build a valid pair of (required, total) encoding parameters.
encodingParameters :: MonadGen m => m (Word16, Word16)
encodingParameters = do
required <- Gen.integral (Range.exponential 1 255)
total <- Gen.integral (Range.exponential (required + 1) 256)
required <- Gen.integral (Range.exponential 1 254)
total <- Gen.integral (Range.exponential (required + 1) 255)
pure (required, total)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment