diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
 # Changelog
 
+## 0.2.0.0 -- 2026-03-23
+
+* BREAKING: change more flags from numbers into datatypes. See PR
+  [#113](https://github.com/haskell-cryptography/botan/pull/113). The flag
+  datatypes come with new helper functions to convert the datatype into a
+  number. The changed flag types are:
+  - `SigningFlags`
+  - `X509KeyConstraints`
+* BREAKING: `x509CertAllowedUsage` now takes a list of `X509KeyConstraints`
+  instead of a single value. See PR
+  [#113](https://github.com/haskell-cryptography/botan/pull/113).
+* BREAKING: for all newtypes with a record field name like `get*ForeignPtr`,
+  change the name to `foreignPtr`. See PR's
+  [#114](https://github.com/haskell-cryptography/botan/pull/114) and
+  [#117](https://github.com/haskell-cryptography/botan/pull/117). For example.
+  `getBlockCipherForeignPtr` is changed to `foreignPtr`.
+
 ## 0.1.0.0 -- 2025-12-30
 
 * BREAKING: remove experimental FFI code related to `x509`. See PR
diff --git a/botan-low.cabal b/botan-low.cabal
--- a/botan-low.cabal
+++ b/botan-low.cabal
@@ -1,6 +1,6 @@
 cabal-version: 3.0
 name: botan-low
-version: 0.1.0.0
+version: 0.2.0.0
 synopsis: Low-level Botan bindings
 description:
   Welcome to botan-low
@@ -50,7 +50,7 @@
   type: git
   location: https://github.com/haskell-cryptography/botan
   subdir: botan-low
-  tag: botan-low-0.1.0.0
+  tag: botan-low-0.2.0.0
 
 common warnings
   ghc-options:
@@ -128,7 +128,7 @@
 
   build-depends:
     base >=4.16 && <4.22,
-    botan-bindings ^>=0.2,
+    botan-bindings ^>=0.3,
     bytestring >=0.11 && <0.13,
     deepseq >=1.1 && <2,
     text >=1.2 && <1.3 || >=2.0 && <2.2,
diff --git a/src/Botan/Low/BlockCipher.hs b/src/Botan/Low/BlockCipher.hs
--- a/src/Botan/Low/BlockCipher.hs
+++ b/src/Botan/Low/BlockCipher.hs
@@ -189,7 +189,7 @@
 -------------------------------------------------------------------------------}
 
 -- | A mutable block cipher object
-newtype BlockCipher = MkBlockCipher { getBlockCipherForeignPtr :: ForeignPtr BotanBlockCipherStruct }
+newtype BlockCipher = MkBlockCipher { foreignPtr :: ForeignPtr BotanBlockCipherStruct }
 
 withBlockCipher     :: BlockCipher -> (BotanBlockCipher -> IO a) -> IO a
 -- | Destroy a block cipher object immediately
@@ -197,8 +197,8 @@
 createBlockCipher   :: (Ptr BotanBlockCipher -> IO CInt) -> IO BlockCipher
 (withBlockCipher, blockCipherDestroy, createBlockCipher)
     = mkBindings
-        MkBotanBlockCipher (.runBotanBlockCipher)
-        MkBlockCipher (.getBlockCipherForeignPtr)
+        MkBotanBlockCipher (.ptr)
+        MkBlockCipher (.foreignPtr)
         botan_block_cipher_destroy
 
 
diff --git a/src/Botan/Low/Cipher.hs b/src/Botan/Low/Cipher.hs
--- a/src/Botan/Low/Cipher.hs
+++ b/src/Botan/Low/Cipher.hs
@@ -195,7 +195,7 @@
 
 -- NOTE: This is *symmetric* ciphers  For the 'raw' interface to ECB mode block ciphers, see BlockCipher.hs
 
-newtype Cipher = MkCipher { getCipherForeignPtr :: ForeignPtr BotanCipherStruct }
+newtype Cipher = MkCipher { foreignPtr :: ForeignPtr BotanCipherStruct }
 
 withCipher     :: Cipher -> (BotanCipher -> IO a) -> IO a
 -- | Destroy the cipher object immediately
@@ -203,8 +203,8 @@
 createCipher   :: (Ptr BotanCipher -> IO CInt) -> IO Cipher
 (withCipher, cipherDestroy, createCipher)
     = mkBindings
-        MkBotanCipher (.runBotanCipher)
-        MkCipher (.getCipherForeignPtr)
+        MkBotanCipher (.ptr)
+        MkCipher (.foreignPtr)
         botan_cipher_destroy
 
 type CipherNonce = ByteString
diff --git a/src/Botan/Low/FPE.hs b/src/Botan/Low/FPE.hs
--- a/src/Botan/Low/FPE.hs
+++ b/src/Botan/Low/FPE.hs
@@ -73,15 +73,15 @@
 -- * Format Preserving Encryption
 -- */
 
-newtype FPE = MkFPE { getFPEForeignPtr :: ForeignPtr BotanFPEStruct }
+newtype FPE = MkFPE { foreignPtr :: ForeignPtr BotanFPEStruct }
 
 withFPE     :: FPE -> (BotanFPE -> IO a) -> IO a
 fpeDestroy  :: FPE -> IO ()
 createFPE   :: (Ptr BotanFPE -> IO CInt) -> IO FPE
 (withFPE, fpeDestroy, createFPE)
     = mkBindings
-        MkBotanFPE (.runBotanFPE)
-        MkFPE (.getFPEForeignPtr)
+        MkBotanFPE (.ptr)
+        MkFPE (.foreignPtr)
         botan_fpe_destroy
 
 data FPEFlags =
diff --git a/src/Botan/Low/HOTP.hs b/src/Botan/Low/HOTP.hs
--- a/src/Botan/Low/HOTP.hs
+++ b/src/Botan/Low/HOTP.hs
@@ -166,15 +166,15 @@
 
 -}
 
-newtype HOTP = MkHOTP { getHOTPForeignPtr :: ForeignPtr BotanHOTPStruct }
+newtype HOTP = MkHOTP { foreignPtr :: ForeignPtr BotanHOTPStruct }
 
 withHOTP     :: HOTP -> (BotanHOTP -> IO a) -> IO a
 hotpDestroy  :: HOTP -> IO ()
 createHOTP   :: (Ptr BotanHOTP -> IO CInt) -> IO HOTP
 (withHOTP, hotpDestroy, createHOTP)
     = mkBindings
-        MkBotanHOTP (.runBotanHOTP)
-        MkHOTP (.getHOTPForeignPtr)
+        MkBotanHOTP (.ptr)
+        MkHOTP (.foreignPtr)
         botan_hotp_destroy
 
 type HOTPHashName = HashName
diff --git a/src/Botan/Low/Hash.hs b/src/Botan/Low/Hash.hs
--- a/src/Botan/Low/Hash.hs
+++ b/src/Botan/Low/Hash.hs
@@ -139,15 +139,15 @@
 
 -}
 
-newtype Hash = MkHash { getHashForeignPtr :: ForeignPtr BotanHashStruct }
+newtype Hash = MkHash { foreignPtr :: ForeignPtr BotanHashStruct }
 
 withHash     :: Hash -> (BotanHash -> IO a) -> IO a
 hashDestroy  :: Hash -> IO ()
 createHash   :: (Ptr BotanHash -> IO CInt) -> IO Hash
 (withHash, hashDestroy, createHash)
     = mkBindings
-        MkBotanHash (.runBotanHash)
-        MkHash (.getHashForeignPtr)
+        MkBotanHash (.ptr)
+        MkHash (.foreignPtr)
         botan_hash_destroy
 
 type HashName = ByteString
diff --git a/src/Botan/Low/MAC.hs b/src/Botan/Low/MAC.hs
--- a/src/Botan/Low/MAC.hs
+++ b/src/Botan/Low/MAC.hs
@@ -162,15 +162,15 @@
 -- * Message Authentication type
 -- */
 
-newtype MAC = MkMAC { getMACForeignPtr :: ForeignPtr BotanMACStruct }
+newtype MAC = MkMAC { foreignPtr :: ForeignPtr BotanMACStruct }
 
 withMAC     :: MAC -> (BotanMAC -> IO a) -> IO a
 macDestroy  :: MAC -> IO ()
 createMAC   :: (Ptr BotanMAC -> IO CInt) -> IO MAC
 (withMAC, macDestroy, createMAC)
     = mkBindings
-        MkBotanMAC (.runBotanMAC)
-        MkMAC (.getMACForeignPtr)
+        MkBotanMAC (.ptr)
+        MkMAC (.foreignPtr)
         botan_mac_destroy
 
 type MACName = ByteString
diff --git a/src/Botan/Low/MPI.hs b/src/Botan/Low/MPI.hs
--- a/src/Botan/Low/MPI.hs
+++ b/src/Botan/Low/MPI.hs
@@ -85,15 +85,15 @@
 -- NOTE: This whole module is not idiomatic - some methods mutate, some have a destination argument
 --  It will need furter wrapping.
 
-newtype MP = MkMP { getMPForeignPtr :: ForeignPtr BotanMPStruct }
+newtype MP = MkMP { foreignPtr :: ForeignPtr BotanMPStruct }
 
 withMP     :: MP -> (BotanMP -> IO a) -> IO a
 mpDestroy  :: MP -> IO ()
 createMP   :: (Ptr BotanMP -> IO CInt) -> IO MP
 (withMP, mpDestroy, createMP)
     = mkBindings
-        MkBotanMP (.runBotanMP)
-        MkMP (.getMPForeignPtr)
+        MkBotanMP (.ptr)
+        MkMP (.foreignPtr)
         botan_mp_destroy
 
 mpInit :: IO MP
diff --git a/src/Botan/Low/PubKey.hs b/src/Botan/Low/PubKey.hs
--- a/src/Botan/Low/PubKey.hs
+++ b/src/Botan/Low/PubKey.hs
@@ -281,15 +281,15 @@
 -- * Public/private key creation, import, ...
 -- */
 
-newtype PrivKey = MkPrivKey { getPrivKeyForeignPtr :: ForeignPtr BotanPrivKeyStruct }
+newtype PrivKey = MkPrivKey { foreignPtr :: ForeignPtr BotanPrivKeyStruct }
 
 withPrivKey     :: PrivKey -> (BotanPrivKey -> IO a) -> IO a
 privKeyDestroy  :: PrivKey -> IO ()
 createPrivKey   :: (Ptr BotanPrivKey -> IO CInt) -> IO PrivKey
 (withPrivKey, privKeyDestroy, createPrivKey)
     = mkBindings
-        MkBotanPrivKey (.runBotanPrivKey)
-        MkPrivKey (.getPrivKeyForeignPtr)
+        MkBotanPrivKey (.ptr)
+        MkPrivKey (.foreignPtr)
         botan_privkey_destroy
 
 type PKName = ByteString
@@ -672,15 +672,15 @@
 --     -> IO ByteString
 -- privKeyExportEncryptedPBKDFIter = undefined
 
-newtype PubKey = MkPubKey { getPubKeyForeignPtr :: ForeignPtr BotanPubKeyStruct }
+newtype PubKey = MkPubKey { foreignPtr :: ForeignPtr BotanPubKeyStruct }
 
 withPubKey     :: PubKey -> (BotanPubKey -> IO a) -> IO a
 pubKeyDestroy  :: PubKey -> IO ()
 createPubKey   :: (Ptr BotanPubKey -> IO CInt) -> IO PubKey
 (withPubKey, pubKeyDestroy, createPubKey)
     = mkBindings
-        MkBotanPubKey (.runBotanPubKey)
-        MkPubKey (.getPubKeyForeignPtr)
+        MkBotanPubKey (.ptr)
+        MkPubKey (.foreignPtr)
         botan_pubkey_destroy
 
 pubKeyLoad
diff --git a/src/Botan/Low/PubKey/Decrypt.hs b/src/Botan/Low/PubKey/Decrypt.hs
--- a/src/Botan/Low/PubKey/Decrypt.hs
+++ b/src/Botan/Low/PubKey/Decrypt.hs
@@ -41,15 +41,15 @@
 -- * Public Key Decryption
 -- */
 
-newtype Decrypt = MkDecrypt { getDecryptForeignPtr :: ForeignPtr BotanPKOpDecryptStruct }
+newtype Decrypt = MkDecrypt { foreignPtr :: ForeignPtr BotanPKOpDecryptStruct }
 
 withDecrypt     :: Decrypt -> (BotanPKOpDecrypt -> IO a) -> IO a
 decryptDestroy  :: Decrypt -> IO ()
 createDecrypt   :: (Ptr BotanPKOpDecrypt -> IO CInt) -> IO Decrypt
 (withDecrypt, decryptDestroy, createDecrypt)
     = mkBindings
-        MkBotanPKOpDecrypt (.runBotanPKOpDecrypt)
-        MkDecrypt (.getDecryptForeignPtr)
+        MkBotanPKOpDecrypt (.ptr)
+        MkDecrypt (.foreignPtr)
         botan_pk_op_decrypt_destroy
 
 decryptCreate
diff --git a/src/Botan/Low/PubKey/Encrypt.hs b/src/Botan/Low/PubKey/Encrypt.hs
--- a/src/Botan/Low/PubKey/Encrypt.hs
+++ b/src/Botan/Low/PubKey/Encrypt.hs
@@ -42,15 +42,15 @@
 -- * Public Key Encryption
 -- */
 
-newtype Encrypt = MkEncrypt { getEncryptForeignPtr :: ForeignPtr BotanPKOpEncryptStruct }
+newtype Encrypt = MkEncrypt { foreignPtr :: ForeignPtr BotanPKOpEncryptStruct }
 
 withEncrypt     :: Encrypt -> (BotanPKOpEncrypt -> IO a) -> IO a
 encryptDestroy  :: Encrypt -> IO ()
 createEncrypt   :: (Ptr BotanPKOpEncrypt -> IO CInt) -> IO Encrypt
 (withEncrypt, encryptDestroy, createEncrypt)
     = mkBindings
-        MkBotanPKOpEncrypt (.runBotanPKOpEncrypt)
-        MkEncrypt (.getEncryptForeignPtr)
+        MkBotanPKOpEncrypt (.ptr)
+        MkEncrypt (.foreignPtr)
         botan_pk_op_encrypt_destroy
 
 encryptCreate
diff --git a/src/Botan/Low/PubKey/KeyAgreement.hs b/src/Botan/Low/PubKey/KeyAgreement.hs
--- a/src/Botan/Low/PubKey/KeyAgreement.hs
+++ b/src/Botan/Low/PubKey/KeyAgreement.hs
@@ -115,15 +115,15 @@
 
 -}
 
-newtype KeyAgreement = MkKeyAgreement { getKeyAgreementForeignPtr :: ForeignPtr BotanPKOpKeyAgreementStruct }
+newtype KeyAgreement = MkKeyAgreement { foreignPtr :: ForeignPtr BotanPKOpKeyAgreementStruct }
 
 withKeyAgreement     :: KeyAgreement -> (BotanPKOpKeyAgreement -> IO a) -> IO a
 keyAgreementDestroy  :: KeyAgreement -> IO ()
 createKeyAgreement   :: (Ptr BotanPKOpKeyAgreement -> IO CInt) -> IO KeyAgreement
 (withKeyAgreement, keyAgreementDestroy, createKeyAgreement)
     = mkBindings
-        MkBotanPKOpKeyAgreement (.runBotanPKOpKeyAgreement)
-        MkKeyAgreement (.getKeyAgreementForeignPtr)
+        MkBotanPKOpKeyAgreement (.ptr)
+        MkKeyAgreement (.foreignPtr)
         botan_pk_op_key_agreement_destroy
 
 -- NOTE: Silently uses the system RNG
diff --git a/src/Botan/Low/PubKey/KeyEncapsulation.hs b/src/Botan/Low/PubKey/KeyEncapsulation.hs
--- a/src/Botan/Low/PubKey/KeyEncapsulation.hs
+++ b/src/Botan/Low/PubKey/KeyEncapsulation.hs
@@ -120,15 +120,15 @@
 type KEMSharedKey = ByteString
 type KEMEncapsulatedKey = ByteString
 
-newtype KEMEncrypt = MkKEMEncrypt { getKEMEncryptForeignPtr :: ForeignPtr BotanPKOpKEMEncryptStruct }
+newtype KEMEncrypt = MkKEMEncrypt { foreignPtr :: ForeignPtr BotanPKOpKEMEncryptStruct }
 
 withKEMEncrypt     :: KEMEncrypt -> (BotanPKOpKEMEncrypt -> IO a) -> IO a
 kemEncryptDestroy  :: KEMEncrypt -> IO ()
 createKEMEncrypt   :: (Ptr BotanPKOpKEMEncrypt -> IO CInt) -> IO KEMEncrypt
 (withKEMEncrypt, kemEncryptDestroy, createKEMEncrypt)
     = mkBindings
-        MkBotanPKOpKEMEncrypt (.runBotanPKOpKEMEncrypt)
-        MkKEMEncrypt (.getKEMEncryptForeignPtr)
+        MkBotanPKOpKEMEncrypt (.ptr)
+        MkKEMEncrypt (.foreignPtr)
         botan_pk_op_kem_encrypt_destroy
 
 
@@ -191,15 +191,15 @@
                                 encapPtr
                                 encapSzPtr
 
-newtype KEMDecrypt = MkKEMDecrypt { getKEMDecryptForeignPtr :: ForeignPtr BotanPKOpKEMDecryptStruct }
+newtype KEMDecrypt = MkKEMDecrypt { foreignPtr :: ForeignPtr BotanPKOpKEMDecryptStruct }
 
 withKEMDecrypt     :: KEMDecrypt -> (BotanPKOpKEMDecrypt -> IO a) -> IO a
 kemDecryptDestroy  :: KEMDecrypt -> IO ()
 createKEMDecrypt   :: (Ptr BotanPKOpKEMDecrypt -> IO CInt) -> IO KEMDecrypt
 (withKEMDecrypt, kemDecryptDestroy, createKEMDecrypt)
     = mkBindings
-        MkBotanPKOpKEMDecrypt (.runBotanPKOpKEMDecrypt)
-        MkKEMDecrypt (.getKEMDecryptForeignPtr)
+        MkBotanPKOpKEMDecrypt (.ptr)
+        MkKEMDecrypt (.foreignPtr)
         botan_pk_op_kem_decrypt_destroy
 
 kemDecryptCreate
diff --git a/src/Botan/Low/PubKey/Sign.hs b/src/Botan/Low/PubKey/Sign.hs
--- a/src/Botan/Low/PubKey/Sign.hs
+++ b/src/Botan/Low/PubKey/Sign.hs
@@ -13,9 +13,8 @@
 
   -- * Public key signatures
     Sign(..)
-  , SigningFlags
-  , pattern StandardFormatSignature
-  , pattern DERFormatSignature
+  , SigningFlags (..)
+  , signingFlags
   , withSign
   , signCreate
   , signDestroy
@@ -47,24 +46,24 @@
 -- * Signature Generation
 -- */
 
-newtype Sign = MkSign { getSignForeignPtr :: ForeignPtr BotanPKOpSignStruct }
+newtype Sign = MkSign { foreignPtr :: ForeignPtr BotanPKOpSignStruct }
 
 withSign     :: Sign -> (BotanPKOpSign -> IO a) -> IO a
 signDestroy  :: Sign -> IO ()
 createSign   :: (Ptr BotanPKOpSign -> IO CInt) -> IO Sign
 (withSign, signDestroy, createSign)
     = mkBindings
-        MkBotanPKOpSign (.runBotanPKOpSign)
-        MkSign (.getSignForeignPtr)
+        MkBotanPKOpSign (.ptr)
+        MkSign (.foreignPtr)
         botan_pk_op_sign_destroy
 
-type SigningFlags = Word32
+data SigningFlags =
+    StandardFormatSignature
+  | DERFormatSignature
 
-pattern StandardFormatSignature   -- ^ Not an actual flags
-    ,   DERFormatSignature
-    ::  SigningFlags
-pattern StandardFormatSignature = BOTAN_PUBKEY_STD_FORMAT_SIGNATURE
-pattern DERFormatSignature = BOTAN_PUBKEY_DER_FORMAT_SIGNATURE
+signingFlags :: SigningFlags -> Word32
+signingFlags StandardFormatSignature = BOTAN_PUBKEY_STD_FORMAT_SIGNATURE
+signingFlags DERFormatSignature      = BOTAN_PUBKEY_DER_FORMAT_SIGNATURE
 
 signCreate
     :: PrivKey      -- ^ __key__
@@ -77,7 +76,7 @@
             out
             skPtr
             (ConstPtr algoPtr)
-            flags
+            (signingFlags flags)
 
 signOutputLength
     :: Sign     -- ^ __op__
diff --git a/src/Botan/Low/PubKey/Verify.hs b/src/Botan/Low/PubKey/Verify.hs
--- a/src/Botan/Low/PubKey/Verify.hs
+++ b/src/Botan/Low/PubKey/Verify.hs
@@ -26,7 +26,7 @@
 import           Botan.Low.Error.Internal
 import           Botan.Low.Internal.ByteString
 import           Botan.Low.PubKey
-import           Botan.Low.PubKey.Sign (SigningFlags)
+import           Botan.Low.PubKey.Sign (SigningFlags, signingFlags)
 import           Botan.Low.Remake
 import           Data.ByteString (ByteString)
 import           Foreign.C.Types
@@ -37,15 +37,15 @@
 -- * Signature Verification
 -- */
 
-newtype Verify = MkVerify { getVerifyForeignPtr :: ForeignPtr BotanPKOpVerifyStruct }
+newtype Verify = MkVerify { foreignPtr :: ForeignPtr BotanPKOpVerifyStruct }
 
 withVerify     :: Verify -> (BotanPKOpVerify -> IO a) -> IO a
 verifyDestroy  :: Verify -> IO ()
 createVerify   :: (Ptr BotanPKOpVerify -> IO CInt) -> IO Verify
 (withVerify, verifyDestroy, createVerify)
     = mkBindings
-        MkBotanPKOpVerify (.runBotanPKOpVerify)
-        MkVerify (.getVerifyForeignPtr)
+        MkBotanPKOpVerify (.ptr)
+        MkVerify (.foreignPtr)
         botan_pk_op_verify_destroy
 
 verifyCreate
@@ -59,7 +59,7 @@
             out
             pkPtr
             (ConstPtr algoPtr)
-            flags
+            (signingFlags flags)
 
 verifyUpdate
     :: Verify       -- ^ __op__
diff --git a/src/Botan/Low/RNG.hs b/src/Botan/Low/RNG.hs
--- a/src/Botan/Low/RNG.hs
+++ b/src/Botan/Low/RNG.hs
@@ -90,14 +90,14 @@
 -- NOTE: Uses ConstPtr / unConstPtr manually
 -- TODO: Take advantage of Remake / better peek / (peekConst or constPeek) functions
 
-newtype RNG = MkRNG { getRNGForeignPtr :: ForeignPtr BotanRNGStruct }
+newtype RNG = MkRNG { foreignPtr :: ForeignPtr BotanRNGStruct }
 
 withRNG     :: RNG -> (BotanRNG -> IO a) -> IO a
 -- | Destroy a random number generator object immediately
 rngDestroy  :: RNG -> IO ()
 createRNG   :: (Ptr BotanRNG -> IO CInt) -> IO RNG
 (withRNG, rngDestroy, createRNG)
-    = mkBindings MkBotanRNG (.runBotanRNG) MkRNG (.getRNGForeignPtr) botan_rng_destroy
+    = mkBindings MkBotanRNG (.ptr) MkRNG (.foreignPtr) botan_rng_destroy
 
 type RNGType = ByteString
 
diff --git a/src/Botan/Low/SRP6.hs b/src/Botan/Low/SRP6.hs
--- a/src/Botan/Low/SRP6.hs
+++ b/src/Botan/Low/SRP6.hs
@@ -276,7 +276,7 @@
 type SRP6AValue = ByteString
 type SRP6SharedSecret = ByteString
 
-newtype SRP6ServerSession = MkSRP6ServerSession { getSRP6ServerSessionForeignPtr :: ForeignPtr BotanSRP6ServerSessionStruct }
+newtype SRP6ServerSession = MkSRP6ServerSession { foreignPtr :: ForeignPtr BotanSRP6ServerSessionStruct }
 
 withSRP6ServerSession     :: SRP6ServerSession -> (BotanSRP6ServerSession -> IO a) -> IO a
 -- | Frees all resources of the SRP-6 server session object
@@ -284,8 +284,8 @@
 createSRP6ServerSession   :: (Ptr BotanSRP6ServerSession -> IO CInt) -> IO SRP6ServerSession
 (withSRP6ServerSession, srp6ServerSessionDestroy, createSRP6ServerSession)
     = mkBindings
-        MkBotanSRP6ServerSession (.runBotanSRP6ServerSession)
-        MkSRP6ServerSession (.getSRP6ServerSessionForeignPtr)
+        MkBotanSRP6ServerSession (.ptr)
+        MkSRP6ServerSession (.foreignPtr)
         botan_srp6_server_session_destroy
 
 -- | Initialize an SRP-6 server session object
diff --git a/src/Botan/Low/TOTP.hs b/src/Botan/Low/TOTP.hs
--- a/src/Botan/Low/TOTP.hs
+++ b/src/Botan/Low/TOTP.hs
@@ -160,15 +160,15 @@
 
 -}
 
-newtype TOTP = MkTOTP { getTOTPForeignPtr :: ForeignPtr BotanTOTPStruct }
+newtype TOTP = MkTOTP { foreignPtr :: ForeignPtr BotanTOTPStruct }
 
 withTOTP     :: TOTP -> (BotanTOTP -> IO a) -> IO a
 totpDestroy  :: TOTP -> IO ()
 createTOTP   :: (Ptr BotanTOTP -> IO CInt) -> IO TOTP
 (withTOTP, totpDestroy, createTOTP)
     = mkBindings
-        MkBotanTOTP (.runBotanTOTP)
-        MkTOTP (.getTOTPForeignPtr)
+        MkBotanTOTP (.ptr)
+        MkTOTP (.foreignPtr)
         botan_totp_destroy
 
 type TOTPHashName = HashName
diff --git a/src/Botan/Low/X509.hs b/src/Botan/Low/X509.hs
--- a/src/Botan/Low/X509.hs
+++ b/src/Botan/Low/X509.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE CPP #-}
+
 {-|
 Module      : Botan.Low.X509
 Description : X.509 Certificates and CRLs
@@ -49,17 +51,9 @@
 
   -- * X509 Key constraints
 
-  , X509KeyConstraints
-  , pattern NoConstraints
-  , pattern DigitalSignature
-  , pattern NonRepudiation
-  , pattern KeyEncipherment
-  , pattern DataEncipherment
-  , pattern KeyAgreement
-  , pattern KeyCertSign
-  , pattern CRLSign
-  , pattern EncipherOnly
-  , pattern DecipherOnly
+  , X509KeyConstraints (..)
+  , x509KeyConstraints
+  , x509KeyConstraintsList
 
   -- * X509 Certificate revocation list
 
@@ -85,6 +79,7 @@
 import           Botan.Low.PubKey
 import           Botan.Low.Remake
 import           Control.Monad
+import           Data.Bits
 import           Data.ByteString (ByteString, packCString)
 import qualified Data.ByteString.Char8 as Char8
 import           Data.Word
@@ -104,14 +99,14 @@
 
 type DistinguishedName = ByteString
 
-newtype X509Cert = MkX509Cert { getX509CertForeignPtr :: ForeignPtr BotanX509CertStruct }
+newtype X509Cert = MkX509Cert { foreignPtr :: ForeignPtr BotanX509CertStruct }
 
 withX509Cert     :: X509Cert -> (BotanX509Cert -> IO a) -> IO a
 -- | Destroy an x509 cert object immediately
 x509CertDestroy  :: X509Cert -> IO ()
 createX509Cert   :: (Ptr BotanX509Cert -> IO CInt) -> IO X509Cert
 (withX509Cert, x509CertDestroy, createX509Cert)
-    = mkBindings MkBotanX509Cert (.runBotanX509Cert) MkX509Cert (.getX509CertForeignPtr) botan_x509_cert_destroy
+    = mkBindings MkBotanX509Cert (.ptr) MkX509Cert (.foreignPtr) botan_x509_cert_destroy
 
 x509CertLoad
     :: ByteString   -- ^ __cert[]__
@@ -241,40 +236,34 @@
 --  only be present if at least one of the bits is set, and
 --  usage is unrestricted if the extension is not present.
 --  That is, it is an optional restriction.
--- pattern NoConstraints = BOTAN_X509_CERT_KEY_CONSTRAINTS_NO_CONSTRAINTS
--- pattern DigitalSignature = BOTAN_X509_CERT_KEY_CONSTRAINTS_DIGITAL_SIGNATURE
--- pattern NonRepudiation = BOTAN_X509_CERT_KEY_CONSTRAINTS_NON_REPUDIATION
--- pattern KeyEncipherment = BOTAN_X509_CERT_KEY_CONSTRAINTS_KEY_ENCIPHERMENT
--- pattern DataEncipherment = BOTAN_X509_CERT_KEY_CONSTRAINTS_DATA_ENCIPHERMENT
--- pattern KeyAgreement = BOTAN_X509_CERT_KEY_CONSTRAINTS_KEY_AGREEMENT
--- pattern KeyCertSign = BOTAN_X509_CERT_KEY_CONSTRAINTS_KEY_CERT_SIGN
--- pattern CRLSign = BOTAN_X509_CERT_KEY_CONSTRAINTS_CRL_SIGN
--- pattern EncipherOnly = BOTAN_X509_CERT_KEY_CONSTRAINTS_ENCIPHER_ONLY
--- pattern DecipherOnly = BOTAN_X509_CERT_KEY_CONSTRAINTS_DECIPHER_ONLY
-type X509KeyConstraints = CUInt
+data X509KeyConstraints =
+    NoConstraints
+  | DigitalSignature
+  | NonRepudiation
+  | KeyEncipherment
+  | DataEncipherment
+  | KeyAgreement
+  | KeyCertSign
+  | CRLSign
+  | EncipherOnly
+  | DecipherOnly
 
-pattern NoConstraints
-    ,   DigitalSignature
-    ,   NonRepudiation
-    ,   KeyEncipherment
-    ,   DataEncipherment
-    ,   KeyAgreement
-    ,   KeyCertSign
-    ,   CRLSign
-    ,   EncipherOnly
-    ,   DecipherOnly
-    ::  X509KeyConstraints
-pattern NoConstraints = NO_CONSTRAINTS
-pattern DigitalSignature = DIGITAL_SIGNATURE
-pattern NonRepudiation = NON_REPUDIATION
-pattern KeyEncipherment = KEY_ENCIPHERMENT
-pattern DataEncipherment = DATA_ENCIPHERMENT
-pattern KeyAgreement = KEY_AGREEMENT
-pattern KeyCertSign = KEY_CERT_SIGN
-pattern CRLSign = CRL_SIGN
-pattern EncipherOnly = ENCIPHER_ONLY
-pattern DecipherOnly = DECIPHER_ONLY
+x509KeyConstraints :: X509KeyConstraints -> CUInt
+x509KeyConstraints NoConstraints    = NO_CONSTRAINTS
+x509KeyConstraints DigitalSignature = DIGITAL_SIGNATURE
+x509KeyConstraints NonRepudiation   = NON_REPUDIATION
+x509KeyConstraints KeyEncipherment  = KEY_ENCIPHERMENT
+x509KeyConstraints DataEncipherment = DATA_ENCIPHERMENT
+x509KeyConstraints KeyAgreement     = KEY_AGREEMENT
+x509KeyConstraints KeyCertSign      = KEY_CERT_SIGN
+x509KeyConstraints CRLSign          = CRL_SIGN
+x509KeyConstraints EncipherOnly     = ENCIPHER_ONLY
+x509KeyConstraints DecipherOnly     = DECIPHER_ONLY
 
+x509KeyConstraintsList :: [X509KeyConstraints] -> CUInt
+x509KeyConstraintsList [] = x509KeyConstraints NoConstraints
+x509KeyConstraintsList (kc:kcs) = x509KeyConstraints kc .|. x509KeyConstraintsList kcs
+
 -- |
 --
 -- NOTE: This function lacks documentation, and it is unknown whether this is
@@ -284,11 +273,11 @@
 -- Note: unexplained function, best-guess implementation
 x509CertAllowedUsage ::
      X509Cert             -- ^ __cert__
-  -> X509KeyConstraints   -- ^ __key_usage__
+  -> [X509KeyConstraints] -- ^ __key_usage__
   -> IO Bool
 x509CertAllowedUsage cert usage =
     withX509Cert cert $ \ certPtr ->
-    throwBotanCatchingInvalidVerifier $ botan_x509_cert_allowed_usage certPtr usage
+    throwBotanCatchingInvalidVerifier $ botan_x509_cert_allowed_usage certPtr (x509KeyConstraintsList usage)
 
 {- |
 Check if the certificate matches the specified hostname via alternative name or CN match.
@@ -365,13 +354,13 @@
 
 -- TODO: Move to Botan.Low.X509.CRL after merging extended FFI
 
-newtype X509CRL = MkX509CRL { getX509CRLForeignPtr :: ForeignPtr BotanX509CRLStruct }
+newtype X509CRL = MkX509CRL { foreignPtr :: ForeignPtr BotanX509CRLStruct }
 
 withX509CRL     :: X509CRL -> (BotanX509CRL -> IO a) -> IO a
 x509CRLDestroy  :: X509CRL -> IO ()
 createX509CRL   :: (Ptr BotanX509CRL -> IO CInt) -> IO X509CRL
 (withX509CRL, x509CRLDestroy, createX509CRL)
-    = mkBindings MkBotanX509CRL (.runBotanX509CRL) MkX509CRL (.getX509CRLForeignPtr) botan_x509_crl_destroy
+    = mkBindings MkBotanX509CRL (.ptr) MkX509CRL (.foreignPtr) botan_x509_crl_destroy
 
 x509CRLLoad
     :: ByteString   -- ^ __crl_bits[]__
diff --git a/test/Test/Botan/Low/PwdHash.hs b/test/Test/Botan/Low/PwdHash.hs
--- a/test/Test/Botan/Low/PwdHash.hs
+++ b/test/Test/Botan/Low/PwdHash.hs
@@ -36,10 +36,10 @@
 -------------------------------------------------------------------------------}
 
 data TestParams = TestParams {
-    testPbkdfName        :: PBKDFName
-  , testIterationsParam  :: Int
-  , testParallelismParam :: Int
-  , testMemoryParam      :: Int
+    pbkdfName        :: PBKDFName
+  , iterationsParam  :: Int
+  , parallelismParam :: Int
+  , memoryParam      :: Int
   }
   deriving stock (Show, Eq)
 
diff --git a/test/Test/Botan/Low/RNG.hs b/test/Test/Botan/Low/RNG.hs
--- a/test/Test/Botan/Low/RNG.hs
+++ b/test/Test/Botan/Low/RNG.hs
@@ -16,11 +16,6 @@
     specs <- testSpec "spec_rng" spec_rng
     pure $ testGroup "Test.Botan.Low.RNG" [
         specs
-#ifdef darwin_HOST_OS
-        -- TODO: temporarily disabled because the test suite fails. See issue
-        -- #33.
-      | False
-#endif
       ]
 
 rngs :: [RNGType]
@@ -28,7 +23,9 @@
     [ SystemRNG
     , UserRNG
     , UserThreadsafeRNG
+#if x86_64_HOST_ARCH
     , RDRandRNG -- NOTES: Not available on all processors
+#endif
     ]
 
 spec_rng :: Spec
diff --git a/test/Test/Botan/Low/X509.hs b/test/Test/Botan/Low/X509.hs
--- a/test/Test/Botan/Low/X509.hs
+++ b/test/Test/Botan/Low/X509.hs
@@ -152,7 +152,7 @@
         pass
     it "x509CertAllowedUsage" $ do
         cert <- x509CertLoad testCert
-        _allowed <- x509CertAllowedUsage cert NoConstraints
+        _allowed <- x509CertAllowedUsage cert []
         pass
     it "x509CertHostnameMatch" $ do
         cert <- x509CertLoad testCert
