12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #include "aes.h"
- #include "cry.h"
- void * aes_encrypt_init(const u8 *key, size_t len)
- {
- u8 *ctx;
-
- ctx = EM_alloc_mem (len);
- if (NULL != ctx)
- {
- memcpy (ctx, key, len);
- }
- return (void *)ctx;
- }
- void aes_encrypt(void *ctx, const u8 *plain, u8 *crypt)
- {
- INT32 ret;
- cry_aes_128_encrypt_be ((UCHAR *)plain, (UCHAR *)ctx, (UCHAR *)crypt, ret);
-
- VOID ret;
- }
- void aes_encrypt_deinit(void *ctx)
- {
- EM_free_mem (ctx);
- }
|