mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-09 07:23:56 +08:00
SM2 KAP (Key Agreement Protocol), not tested
This commit is contained in:
@@ -50,18 +50,14 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "sms4.h"
|
||||
#include <assert.h>
|
||||
#include <openssl/sms4.h>
|
||||
#include <openssl/modes.h>
|
||||
|
||||
void sms4_ecb_encrypt(const unsigned char *in, unsigned char *out, sms4_key_t *key, int encrypt) {
|
||||
assert(in && out && key);
|
||||
if(encrypt)
|
||||
sms4_encrypt(in, out, key);
|
||||
else
|
||||
sms4_decrypt(in, out, key);
|
||||
void sms4_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const sms4_key_t *key, int enc)
|
||||
{
|
||||
if (enc)
|
||||
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