Merge pull request #80 from haskell-crypto/basepoint-fix
[Ed448] Fixed incorrect base point
This commit is contained in:
commit
a1847c2e0b
@ -89,7 +89,7 @@ toPublic (SecretKey sec) = PublicKey <$>
|
|||||||
withByteArray sec $ \psec ->
|
withByteArray sec $ \psec ->
|
||||||
ccryptonite_ed448 result psec basePoint
|
ccryptonite_ed448 result psec basePoint
|
||||||
where
|
where
|
||||||
basePoint = Ptr "\x05\x00\x00\x00\x00\x00\x00\x00\x00x00\x00\x00\x00\x00\x00\x00\x00x00\x00\x00\x00\x00\x00\x00\x00x00\x00\x00\x00\x00\x00\x00\x00x00\x00\x00\x00\x00\x00\x00\x00x00\x00\x00\x00\x00\x00\x00\x00x00\x00\x00\x00\x00\x00\x00"#
|
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 #-}
|
||||||
|
|
||||||
x448_bytes :: Int
|
x448_bytes :: Int
|
||||||
|
|||||||
@ -16,6 +16,8 @@ katTests :: [TestTree]
|
|||||||
katTests =
|
katTests =
|
||||||
[ testCase "0" (aliceMultBob @=? B.convert (Ed448.dh alicePublic bobPrivate))
|
[ testCase "0" (aliceMultBob @=? B.convert (Ed448.dh alicePublic bobPrivate))
|
||||||
, testCase "1" (aliceMultBob @=? B.convert (Ed448.dh bobPublic alicePrivate))
|
, testCase "1" (aliceMultBob @=? B.convert (Ed448.dh bobPublic alicePrivate))
|
||||||
|
, testCase "2" (alicePublic @=? Ed448.toPublic alicePrivate)
|
||||||
|
, testCase "3" (bobPublic @=? Ed448.toPublic bobPrivate)
|
||||||
]
|
]
|
||||||
|
|
||||||
tests = testGroup "Ed448"
|
tests = testGroup "Ed448"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user