Merge pull request #80 from haskell-crypto/basepoint-fix

[Ed448] Fixed incorrect base point
This commit is contained in:
Vincent Hanquez 2016-04-19 04:42:30 +01:00
commit a1847c2e0b
2 changed files with 3 additions and 1 deletions

View File

@ -89,7 +89,7 @@ toPublic (SecretKey sec) = PublicKey <$>
withByteArray sec $ \psec ->
ccryptonite_ed448 result psec basePoint
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 #-}
x448_bytes :: Int

View File

@ -16,6 +16,8 @@ katTests :: [TestTree]
katTests =
[ testCase "0" (aliceMultBob @=? B.convert (Ed448.dh alicePublic bobPrivate))
, testCase "1" (aliceMultBob @=? B.convert (Ed448.dh bobPublic alicePrivate))
, testCase "2" (alicePublic @=? Ed448.toPublic alicePrivate)
, testCase "3" (bobPublic @=? Ed448.toPublic bobPrivate)
]
tests = testGroup "Ed448"