mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-09 07:23:56 +08:00
update
This commit is contained in:
15
crypto/sms4/sms4_ecb.c
Normal file
15
crypto/sms4/sms4_ecb.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "sms4.h"
|
||||
#include <assert.h>
|
||||
|
||||
void sms4_ecb_encrypt(const unsigned char *in, unsigned char *out, const sms4_key_t *key, int encrypt) {
|
||||
assert(in && out && key);
|
||||
if(encrypt)
|
||||
sms4_encrypt(in, out, key);
|
||||
else
|
||||
sms4_decrypt(in, out, key);
|
||||
}
|
||||
|
||||
//sms4_decrypt = sms4_encrypt, but the key is in reverse order
|
||||
Reference in New Issue
Block a user