2024-09-03 14:28:14 +08:00
|
|
|
//go:build s390x && !purego
|
|
|
|
|
|
|
|
package sm3
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestTransposeMatrix(t *testing.T) {
|
|
|
|
var m [4][8]uint32
|
2024-09-03 15:20:10 +08:00
|
|
|
var k uint32 = 0
|
2024-09-03 14:28:14 +08:00
|
|
|
for i := 0; i < 4; i++ {
|
|
|
|
for j := 0; j < 8; j++ {
|
2024-09-03 15:20:10 +08:00
|
|
|
m[i][j] = k
|
|
|
|
k++
|
2024-09-03 14:28:14 +08:00
|
|
|
fmt.Printf("%04x ", m[i][j])
|
|
|
|
}
|
|
|
|
fmt.Println()
|
|
|
|
}
|
|
|
|
input := [4]*[8]uint32{&m[0], &m[1], &m[2], &m[3]}
|
|
|
|
transposeMatrix(&input[0])
|
2024-09-03 15:20:10 +08:00
|
|
|
fmt.Println()
|
2024-09-03 16:16:56 +08:00
|
|
|
fmt.Println()
|
2024-09-03 14:28:14 +08:00
|
|
|
for i := 0; i < 4; i++ {
|
|
|
|
for j := 0; j < 8; j++ {
|
|
|
|
fmt.Printf("%04x ", m[i][j])
|
|
|
|
}
|
|
|
|
fmt.Println()
|
|
|
|
}
|
|
|
|
}
|