sm3: ppc64x, remove useless files

This commit is contained in:
Sun Yimin 2024-09-06 11:06:13 +08:00 committed by GitHub
parent 077b115c29
commit e3c178c724
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 72 deletions

View File

@ -1,13 +0,0 @@
// Copyright 2024 Sun Yimin. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
//go:build (ppc64 || ppc64le) && !purego
package sm3
//go:noescape
func transposeMatrix(dig **[8]uint32)
//go:noescape
func copyResultsBy4(dig *uint32, p *byte)

View File

@ -1,59 +0,0 @@
// Copyright 2024 Sun Yimin. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
//go:build (ppc64 || ppc64le) && !purego
package sm3
import (
"encoding/binary"
"fmt"
"testing"
)
func TestTransposeMatrix(t *testing.T) {
var m [4][8]uint32
var k uint32 = 0
for i := 0; i < 4; i++ {
for j := 0; j < 8; j++ {
m[i][j] = k
k++
fmt.Printf("%08x ", m[i][j])
}
fmt.Println()
}
input := [4]*[8]uint32{&m[0], &m[1], &m[2], &m[3]}
transposeMatrix(&input[0])
fmt.Println()
fmt.Println()
for i := 0; i < 4; i++ {
for j := 0; j < 8; j++ {
fmt.Printf("%08x ", m[i][j])
}
fmt.Println()
}
}
func TestCopyResultsBy4(t *testing.T) {
var m [4][8]uint32
var ret [128]byte
var k uint32 = 0
for i := 0; i < 4; i++ {
for j := 0; j < 8; j++ {
m[i][j] = k
k++
fmt.Printf("%08x ", m[i][j])
}
fmt.Println()
}
copyResultsBy4(&m[0][0], &ret[0])
fmt.Printf("got: %x\n", ret[:])
for i := 0; i < 4; i++ {
for j := 0; j < 8; j++ {
binary.BigEndian.PutUint32(ret[i*32+j*4:], m[i][j])
}
}
fmt.Printf("expected %x\n", ret[:])
}