new modules

This commit is contained in:
Zhi Guan
2015-10-05 15:34:54 +08:00
parent 8afb3ef97b
commit 254a1266d6
49 changed files with 4895 additions and 187 deletions

51
crypto/zuc/zuc.h Executable file
View File

@@ -0,0 +1,51 @@
#ifndef HEADER_ZUC_H
#define HEADER_ZUC_H
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
uint32_t LFSR_S0;
uint32_t LFSR_S1;
uint32_t LFSR_S2;
uint32_t LFSR_S3;
uint32_t LFSR_S4;
uint32_t LFSR_S5;
uint32_t LFSR_S6;
uint32_t LFSR_S7;
uint32_t LFSR_S8;
uint32_t LFSR_S9;
uint32_t LFSR_S10;
uint32_t LFSR_S11;
uint32_t LFSR_S12;
uint32_t LFSR_S13;
uint32_t LFSR_S14;
uint32_t LFSR_S15;
/* the registers of F */
uint32_t F_R1;
uint32_t F_R2;
/* the outputs of BitReorganization */
uint32_t BRC_X0;
uint32_t BRC_X1;
uint32_t BRC_X2;
uint32_t BRC_X3;
} ZUC_KEY;
void ZUC_set_key(ZUC_KEY *key, const unsigned char *k, const unsigned char *iv);
void ZUC_encrypt(ZUC_KEY *key, size_t inlen, const unsigned char *in, unsigned char *out);
#ifdef __cplusplus
}
#endif
#endif