mirror of
https://github.com/hanzozt/dilithium.git
synced 2026-10-30 20:38:17 +00:00
23 lines
470 B
Go
23 lines
470 B
Go
package westworld3
|
|
|
|
import (
|
|
"encoding/hex"
|
|
"fmt"
|
|
"github.com/stretchr/testify/assert"
|
|
"testing"
|
|
)
|
|
|
|
func TestHelloEncodeDecode(t *testing.T) {
|
|
data := make([]byte, 5)
|
|
sz, err := encodeHello(hello{9006, 0xF}, data)
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, uint32(5), sz)
|
|
|
|
fmt.Println(hex.Dump(data))
|
|
|
|
outHello, _, err2 := decodeHello(data)
|
|
assert.NoError(t, err2)
|
|
assert.Equal(t, uint32(9006), outHello.version)
|
|
assert.Equal(t, uint8(0xF), outHello.profile)
|
|
}
|