mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-22 02:06:18 +08:00
32 lines
1011 B
Go
32 lines
1011 B
Go
package sm4
|
|
|
|
import "crypto/cipher"
|
|
|
|
// cbcEncAble is implemented by cipher.Blocks that can provide an optimized
|
|
// implementation of CBC encryption through the cipher.BlockMode interface.
|
|
// See crypto/cipher/cbc.go.
|
|
type cbcEncAble interface {
|
|
NewCBCEncrypter(iv []byte) cipher.BlockMode
|
|
}
|
|
|
|
// cbcDecAble is implemented by cipher.Blocks that can provide an optimized
|
|
// implementation of CBC decryption through the cipher.BlockMode interface.
|
|
// See crypto/cipher/cbc.go.
|
|
type cbcDecAble interface {
|
|
NewCBCDecrypter(iv []byte) cipher.BlockMode
|
|
}
|
|
|
|
// ctrAble is implemented by cipher.Blocks that can provide an optimized
|
|
// implementation of CTR through the cipher.Stream interface.
|
|
// See crypto/cipher/ctr.go.
|
|
type ctrAble interface {
|
|
NewCTR(iv []byte) cipher.Stream
|
|
}
|
|
|
|
// gcmAble is implemented by cipher.Blocks that can provide an optimized
|
|
// implementation of GCM through the AEAD interface.
|
|
// See crypto/cipher/gcm.go.
|
|
type gcmAble interface {
|
|
NewGCM(nonceSize, tagSize int) (cipher.AEAD, error)
|
|
}
|