init: v1.0.0

This commit is contained in:
yaole
2026-05-27 23:03:00 +08:00
commit 8d97f750eb
466 changed files with 80067 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
//go:build amd64 || arm64
// +build amd64 arm64
package sm4
import "crypto/cipher"
/*TODO use aesni to improve performance */
type sm4CipherGCM struct {
sm4CipherAsm
}
// NewGCM returns the SM4 cipher wrapped in Galois Counter Mode. This is only
// called by crypto/cipher.NewGCM via the gcmAble interface.
//
// 调用crypto/cipher.NewGCM的时候在回调sm4CipherGCM.NewGCM
func (c *sm4CipherGCM) NewGCM(nonceSize, tagSize int) (cipher.AEAD, error) {
// TODO 判断size,先返回错误
// 现在是默认实现-sm4CipherAsm没有gcmAble接口
return cipher.NewGCM(&c.sm4CipherAsm)
}