File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,29 @@ describe("signExtended", () => {
38
38
} ) ;
39
39
} ) ;
40
40
41
+
42
+ describe ( "sign" , ( ) => {
43
+ let privateKey = CSL . PrivateKey . generate_ed25519 ( ) ;
44
+ let msg = new Uint8Array ( [ 1 , 2 , 3 ] ) ;
45
+
46
+ test ( "signature must be same as CSL" , ( ) => {
47
+ expect ( thisLib . sign ( msg , privateKey . as_bytes ( ) ) ) . toEqual (
48
+ privateKey . sign ( msg ) . to_bytes ( ) ,
49
+ ) ;
50
+ } ) ;
51
+
52
+ test ( "signature should verify" , ( ) => {
53
+ let signature = thisLib . sign ( msg , privateKey . as_bytes ( ) ) ;
54
+ expect (
55
+ nacl . sign . detached . verify (
56
+ msg ,
57
+ signature ,
58
+ privateKey . to_public ( ) . as_bytes ( ) ,
59
+ ) ,
60
+ ) . toEqual ( true ) ;
61
+ } ) ;
62
+ } ) ;
63
+
41
64
describe ( "secretToExtended" , ( ) => {
42
65
let regressionKeys = [
43
66
"4428f1b59d357c10bca5ae134b767359d1f8f66fde851503b56f297cf599f456" ,
You can’t perform that action at this time.
0 commit comments