Use decaf_x448_derive_public_key
This commit is contained in:
parent
6b4621b14f
commit
6fb412e2af
@ -93,9 +93,7 @@ toPublic :: SecretKey -> PublicKey
|
|||||||
toPublic (SecretKey sec) = PublicKey <$>
|
toPublic (SecretKey sec) = PublicKey <$>
|
||||||
B.allocAndFreeze x448_bytes $ \result ->
|
B.allocAndFreeze x448_bytes $ \result ->
|
||||||
withByteArray sec $ \psec ->
|
withByteArray sec $ \psec ->
|
||||||
decaf_x448 result basePoint psec
|
decaf_x448_derive_public_key result psec
|
||||||
where
|
|
||||||
basePoint = Ptr "\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
|
|
||||||
{-# NOINLINE toPublic #-}
|
{-# NOINLINE toPublic #-}
|
||||||
|
|
||||||
-- | Generate a secret key.
|
-- | Generate a secret key.
|
||||||
@ -110,3 +108,8 @@ foreign import ccall "cryptonite_decaf_x448"
|
|||||||
-> Ptr Word8 -- ^ basepoint
|
-> Ptr Word8 -- ^ basepoint
|
||||||
-> Ptr Word8 -- ^ secret
|
-> Ptr Word8 -- ^ secret
|
||||||
-> IO ()
|
-> IO ()
|
||||||
|
|
||||||
|
foreign import ccall "cryptonite_decaf_x448_derive_public_key"
|
||||||
|
decaf_x448_derive_public_key :: Ptr Word8 -- ^ public
|
||||||
|
-> Ptr Word8 -- ^ secret
|
||||||
|
-> IO ()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user