mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-28 13:16:19 +08:00
test arm64 gcm
This commit is contained in:
parent
0f1e6714aa
commit
8691a605e2
22
sm4/sm4_gcm_test.go
Normal file
22
sm4/sm4_gcm_test.go
Normal file
@ -0,0 +1,22 @@
|
||||
//go:build amd64 || arm64
|
||||
// +build amd64 arm64
|
||||
|
||||
package sm4
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPrecomputeTableAsm(t *testing.T) {
|
||||
key := []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
|
||||
c := sm4CipherAsm{sm4Cipher{make([]uint32, rounds), make([]uint32, rounds)}}
|
||||
expandKeyAsm(&key[0], &ck[0], &c.enc[0], &c.dec[0])
|
||||
c1 := &sm4CipherGCM{c}
|
||||
g := &gcmAsm{}
|
||||
g.cipher = &c1.sm4CipherAsm
|
||||
var key1 [gcmBlockSize]byte
|
||||
c1.Encrypt(key1[:], key1[:])
|
||||
precomputeTableAsm(&g.bytesProductTable, &key1)
|
||||
fmt.Printf("%v\n", g.bytesProductTable)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user