mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 12:16:20 +08:00
pkcs7: support older CFCA integration #225
This commit is contained in:
parent
23081971e8
commit
4db3046001
@ -53,3 +53,13 @@ var SM4GCM = &gcmBlockCipher{
|
||||
},
|
||||
nonceSize: 12,
|
||||
}
|
||||
|
||||
// SM4 is the 128-bit key SM4 cipher in CBC mode, it's just for CFCA.
|
||||
var SM4 = &cbcBlockCipher{
|
||||
baseBlockCipher: baseBlockCipher{
|
||||
keySize: 16,
|
||||
newBlock: sm4.NewCipher,
|
||||
oid: oidSM4,
|
||||
},
|
||||
ivSize: sm4.BlockSize,
|
||||
}
|
||||
|
@ -93,6 +93,7 @@ func TestEncryptSM(t *testing.T) {
|
||||
|
||||
func TestEncryptCFCA(t *testing.T) {
|
||||
ciphers := []pkcs.Cipher{
|
||||
pkcs.SM4,
|
||||
pkcs.SM4CBC,
|
||||
pkcs.SM4GCM,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user