remove useless function
This commit is contained in:
parent
087a2f118a
commit
1a8a5aef62
@ -11,7 +11,6 @@
|
|||||||
module Crypto.Internal.Bytes
|
module Crypto.Internal.Bytes
|
||||||
( withByteStringPtr
|
( withByteStringPtr
|
||||||
, tempBufCreate
|
, tempBufCreate
|
||||||
, bufCreate
|
|
||||||
, bufXor
|
, bufXor
|
||||||
) where
|
) where
|
||||||
|
|
||||||
@ -21,7 +20,6 @@ import Foreign.ForeignPtr (withForeignPtr)
|
|||||||
import Foreign.Storable (peek, poke)
|
import Foreign.Storable (peek, poke)
|
||||||
import Foreign.Marshal.Alloc (allocaBytesAligned)
|
import Foreign.Marshal.Alloc (allocaBytesAligned)
|
||||||
import Data.ByteString (ByteString)
|
import Data.ByteString (ByteString)
|
||||||
import Data.ByteString.Internal (ByteString(..), mallocByteString)
|
|
||||||
import Data.Bits (xor)
|
import Data.Bits (xor)
|
||||||
import Data.Word (Word8)
|
import Data.Word (Word8)
|
||||||
import Data.ByteString.Internal (toForeignPtr)
|
import Data.ByteString.Internal (toForeignPtr)
|
||||||
@ -31,13 +29,6 @@ withByteStringPtr b f =
|
|||||||
withForeignPtr fptr $ \ptr -> f (ptr `plusPtr` off)
|
withForeignPtr fptr $ \ptr -> f (ptr `plusPtr` off)
|
||||||
where (fptr, off, _) = toForeignPtr b
|
where (fptr, off, _) = toForeignPtr b
|
||||||
|
|
||||||
-- | Create a buffer, and turns the final resulting ByteString
|
|
||||||
bufCreate :: Int -> (Ptr Word8 -> IO ()) -> IO ByteString
|
|
||||||
bufCreate size f = do
|
|
||||||
fptr <- mallocByteString size
|
|
||||||
withForeignPtr fptr f
|
|
||||||
return $! PS fptr 0 size
|
|
||||||
|
|
||||||
-- | Create a new temporary buffer
|
-- | Create a new temporary buffer
|
||||||
tempBufCreate :: Int -> (Ptr Word8 -> IO a) -> IO a
|
tempBufCreate :: Int -> (Ptr Word8 -> IO a) -> IO a
|
||||||
tempBufCreate size f = allocaBytesAligned size 8 f
|
tempBufCreate size f = allocaBytesAligned size 8 f
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user