This commit is contained in:
Zhi Guan
2015-08-15 15:02:15 +08:00
parent 06df2fab54
commit 3bdc0ea895
2536 changed files with 417052 additions and 271997 deletions

15
crypto/sms4/sms4_ecb.c Normal file
View 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