mirror of
https://github.com/kazu-yamamoto/crypton.git
synced 2024-10-05 16:27:35 +03:00
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 ->
|
||||
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
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user