Skip to content

Commit

Permalink
kyber test
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio committed Jul 25, 2023
1 parent 1bb39fb commit 4de850b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"github.com/acheong08/crystals-go/dilithium"
"github.com/acheong08/crystals-go/kyber"
)

// Just testing a few things to make sure the code is working
Expand All @@ -15,4 +16,15 @@ func main() {
} else {
println("success")
}
k := kyber.NewKyber512()
pk, sk = k.KeyGen([]byte("test"))
msg = []byte("hello world")
c, ss := k.Encaps(pk, msg)
newss := k.Decaps(sk, c)
// Convert to string and compare
if string(ss) != string(newss) {
panic("failed")
} else {
println("success")
}
}

0 comments on commit 4de850b

Please sign in to comment.