-
Notifications
You must be signed in to change notification settings - Fork 1
/
sm4.h
22 lines (12 loc) · 833 Bytes
/
sm4.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef SM_4_H
#define SM_4_H
#include <stdint.h>
extern void sm4_encrypt_ecb(const uint8_t *, uint64_t, const uint32_t *, uint8_t *);
extern void sm4_decrypt_ecb(const uint8_t *, uint64_t, const uint32_t *, uint8_t *);
extern void sm4_encrypt_cbc(const uint8_t *, uint64_t, const uint32_t *, const uint8_t *, uint8_t *);
extern void sm4_decrypt_cbc(const uint8_t *, uint64_t, const uint32_t *, const uint8_t *, uint8_t *);
extern void sm4_encrypt_cfb(const uint8_t *, uint64_t, const uint32_t *, const uint8_t *, uint8_t *);
extern void sm4_decrypt_cfb(const uint8_t *, uint64_t, const uint32_t *, const uint8_t *, uint8_t *);
extern void sm4_encrypt_block_ecb(const uint8_t[16], uint64_t, const uint32_t[4], uint8_t *);
extern void sm4_decrypt_block_ecb(const uint8_t[16], uint64_t, const uint32_t[4], uint8_t *);
#endif