mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-27 20:56:18 +08:00
sm4: add cbcEncAble interface
This commit is contained in:
parent
206c8075c3
commit
5b075213c0
@ -10,8 +10,8 @@ import (
|
||||
"github.com/emmansun/gmsm/internal/xor"
|
||||
)
|
||||
|
||||
// Assert that sm4CipherAsm implements the cbcDecAble interfaces.
|
||||
var _ cbcDecAble = (*sm4CipherAsm)(nil)
|
||||
// Assert that sm4CipherAsm implements the cbcEncAble and cbcDecAble interfaces.
|
||||
var _ cbcEncAble = (*sm4CipherAsm)(nil)
|
||||
var _ cbcDecAble = (*sm4CipherAsm)(nil)
|
||||
|
||||
const cbcEncrypt = 1
|
||||
|
@ -2,6 +2,13 @@ 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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user