mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-10 16:03:48 +08:00
update
This commit is contained in:
15
crypto/sms4/sms4_cbc.c
Normal file
15
crypto/sms4/sms4_cbc.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "sms4.h"
|
||||
|
||||
void sms4_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const sms4_key_t *key,
|
||||
unsigned char *ivec, int encrypt) {
|
||||
if(encrypt)
|
||||
CRYPTO_cbc128_encrypt(in,out,len,key,ivec,(block128_f)sms4_encrypt);
|
||||
else
|
||||
CRYPTO_cbc128_decrypt(in,out,len,key,ivec,(block128_f)sms4_encrypt);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user