@@ -34,12 +34,16 @@ var _ = Describe("ed25519", func() {
34
34
})
35
35
})
36
36
// Test vectors : https://asecuritysite.com/ecc/eddsa4
37
- DescribeTable ("Compressed PubKey " , func (secrethex string , expected string ) {
37
+ DescribeTable ("Compressed Point " , func (secrethex string , expected string , isHash bool ) {
38
38
secret , _ := new (big.Int ).SetString (secrethex , 16 )
39
- Expect (hex .EncodeToString (Ed25519 ().CompressedPublicKey (secret , "test" )) == expected ).Should (BeTrue ())
39
+ pubKey := Ed25519 ().CompressedPoint (secret , isHash )
40
+ Expect (hex .EncodeToString (pubKey ) == expected ).Should (BeTrue ())
40
41
},
41
- Entry ("case1:" , "9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60" , "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a" ),
42
- Entry ("case2:" , "4ccd089b28ff96da9db6c346ec114e0f5b8a319f35aba624da8cf6ed4fb8a6fb" , "3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c" ),
43
- Entry ("case3:" , "c5aa8df43f9f837bedb7442f31dcb7b166d38535076f094b85ce3a2e0b4458f7" , "fc51cd8e6218a1a38da47ed00230f0580816ed13ba3303ac5deb911548908025" ),
42
+ Entry ("case1:" , "9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60" , "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a" , true ),
43
+ Entry ("case2:" , "4ccd089b28ff96da9db6c346ec114e0f5b8a319f35aba624da8cf6ed4fb8a6fb" , "3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c" , true ),
44
+ Entry ("case3:" , "c5aa8df43f9f837bedb7442f31dcb7b166d38535076f094b85ce3a2e0b4458f7" , "fc51cd8e6218a1a38da47ed00230f0580816ed13ba3303ac5deb911548908025" , true ),
45
+ Entry ("case4:" , "f8c5fe7ef12d7a7f787aa7c3ba107b07f15b9de49528b681f3229f5cb62e725f" , "78701ff87a9da875b1aca15421a7974ab753df5f1dd8abff20aa1cca0eca32ab" , false ),
46
+ Entry ("case5:" , "c08190be7808e5a48713eef997775fa5c4ecc8beb3c6ea4c8800ea66b82e725f" , "a1ab9daf42b069c127c76a9c9ba18351abc6e88b427f988b372db6f63c67bc9f" , false ),
47
+ Entry ("case6:" , "18e0793579b9a9e4bdda1b6080af8afacf4ced61c6da7d2c54d25175bf2e725f" , "8d6929446ef260a556a8a5a4f7f7349611b34b49888abce2a1f2e24634783022" , false ),
44
48
)
45
49
})
0 commit comments