diff options
-rw-r--r-- | Storage.hs | 13 | ||||
-rw-r--r-- | keysafe.cabal | 1 |
2 files changed, 8 insertions, 6 deletions
@@ -21,6 +21,7 @@ import System.IO import System.FilePath import Control.Monad import Crypto.Random +import Control.Concurrent.Async import qualified Data.Set as S import Network.Wai.Handler.Warp (Port) @@ -143,19 +144,19 @@ storeChaff hn port = forever $ do -- Prefix "random chaff" to the name to avoid ever using a name -- that a real user might want to use. let sis = shareIdents testModeTunables (Name $ "random chaff:" <> randomname) (KeyFile "random") - go sis rng' (concat (repeat knownObjectSizes)) + mapConcurrently (go sis rng' (concat (repeat knownObjectSizes))) + [1..totalObjects (shareParams testModeTunables)] where server = networkStorage Nothing $ Server hn port - go _ _ [] = return () - go sis rng (s:sizes) = do + go _ _ [] _ = return () + go sis rng (s:sizes) n = do let (b, rng') = cprgGenerate s rng let share = Share 0 (StorableObject b) - let ident = StorableObjectIdent let (is, sis') = nextShareIdents sis - let i = head (S.toList is) + let i = S.toList is !! (n - 1) r <- storeShare server i share case r of StoreSuccess -> putStr "." _ -> putStr "!" hFlush stdout - go sis' rng' sizes + go sis' rng' sizes n diff --git a/keysafe.cabal b/keysafe.cabal index e6405d5..b99bbf6 100644 --- a/keysafe.cabal +++ b/keysafe.cabal @@ -68,6 +68,7 @@ Executable keysafe , fast-logger == 2.4.* , SafeSemaphore == 0.10.* , crypto-random == 0.0.* + , async == 2.1.* -- Temporarily inlined due to FTBFS bug -- https://github.com/ocharles/argon2/issues/2 -- argon2 == 1.1.* |