diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE TemplateHaskell #-}
 import Distribution.Simple
 import Distribution.Simple.LocalBuildInfo
 import Distribution.Simple.Setup
@@ -8,6 +9,7 @@
 import System.Process
 import System.Directory
 import System.Exit
+import Language.Haskell.TH (appE, varE, mkName, conE)
 
 main = defaultMainWithHooks hk
  where
@@ -30,8 +32,12 @@
 aesArgsHC = map ("-optc" ++) aesArgs
 
 canUseAesIntrinsicsFlag :: FilePath -> IO Bool
-canUseAesIntrinsicsFlag cc = do
-        withTempDirectory normal "" "testIntrinsic" $ \tmpDir -> do
+canUseAesIntrinsicsFlag cc =
+        -- withTempDirectory normal False "" "testRDRAND" $ \tmpDir -> do
+        $(if cabalVersion >= Version [1,17,0] []
+            then  appE (appE (varE $ mkName "withTempDirectory") (varE 'normal)) (conE (mkName "False"))
+            else  appE (varE $ mkName "withTempDirectory") (varE 'normal)) "" "testRDRAND" $ \tmpDir -> do
+
         writeFile (tmpDir ++ "/testIntrinsic.c")
                 (unlines        [ "#include <wmmintrin.h>"
                                 , "int main() {"
diff --git a/cipher-aes128.cabal b/cipher-aes128.cabal
--- a/cipher-aes128.cabal
+++ b/cipher-aes128.cabal
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                cipher-aes128
-version:             0.3.2
+version:             0.3.2.1
 synopsis:            AES128 using AES-NI when available.
 description:         AES128 with crypto-api instances and a trampoline between Vincent Hanquez's C-based and x86 NI-based AES.  Patches welcome to add additional high-performance backends (ARM?)
 license:             BSD3
