Skip to content

Commit

Permalink
sm3: ppc64x, kdf mult by 4
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun authored Sep 6, 2024
1 parent 6e8a3cc commit 077b115
Show file tree
Hide file tree
Showing 5 changed files with 355 additions and 99 deletions.
2 changes: 1 addition & 1 deletion sm3/kdf_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

//go:build purego || !(amd64 || arm64 || s390x)
//go:build purego || !(amd64 || arm64 || s390x || ppc64 || ppc64le)

package sm3

Expand Down
2 changes: 1 addition & 1 deletion sm3/kdf_mult4_asm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

//go:build (amd64 || arm64 || s390x) && !purego
//go:build (amd64 || arm64 || s390x || ppc64 || ppc64le) && !purego

package sm3

Expand Down
15 changes: 15 additions & 0 deletions sm3/kdf_ppc64x.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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

func kdf(baseMD *digest, keyLen int, limit int) []byte {
if limit < 4 {
return kdfGeneric(baseMD, keyLen, limit)
}

return kdfBy4(baseMD, keyLen, limit)
}
Loading

0 comments on commit 077b115

Please sign in to comment.