03b01d2 |
Jamozed |
2022-03-06 17:10:01 |
0
|
// util/rc2.h, version 1.0.1 |
c01a723 |
Jamozed |
2022-02-05 19:04:03 |
1
|
// RC2 header file from libutil |
c01a723 |
Jamozed |
2022-02-05 19:04:03 |
2
|
// Copyright (C) 2021, Jakob Wakeling |
03b01d2 |
Jamozed |
2022-03-06 17:10:01 |
3
|
// MIT Licence |
0737d9e |
Jamozed |
2021-02-21 23:43:21 |
4
|
|
c01a723 |
Jamozed |
2022-02-05 19:04:03 |
5
|
#ifndef UTIL_RC2_H_PMXL29JH |
c01a723 |
Jamozed |
2022-02-05 19:04:03 |
6
|
#define UTIL_RC2_H_PMXL29JH |
03b01d2 |
Jamozed |
2022-03-06 17:10:01 |
7
|
|
03b01d2 |
Jamozed |
2022-03-06 17:10:01 |
8
|
#ifdef __cplusplus |
03b01d2 |
Jamozed |
2022-03-06 17:10:01 |
9
|
extern "C" { |
03b01d2 |
Jamozed |
2022-03-06 17:10:01 |
10
|
#endif |
0737d9e |
Jamozed |
2021-02-21 23:43:21 |
11
|
|
0737d9e |
Jamozed |
2021-02-21 23:43:21 |
12
|
#include <stdint.h> |
c01a723 |
Jamozed |
2022-02-05 19:04:03 |
13
|
#include <stdlib.h> |
0737d9e |
Jamozed |
2021-02-21 23:43:21 |
14
|
|
c01a723 |
Jamozed |
2022-02-05 19:04:03 |
15
|
struct rc2 { union { uint16_t k[64]; uint8_t l[128]; }; }; |
0737d9e |
Jamozed |
2021-02-21 23:43:21 |
16
|
|
c01a723 |
Jamozed |
2022-02-05 19:04:03 |
17
|
extern void rc2expand(struct rc2 *ctx, const uint8_t *key, int len, int ekl); |
c01a723 |
Jamozed |
2022-02-05 19:04:03 |
18
|
extern void rc2encrypt(struct rc2 *ctx, uint8_t *in, uint8_t *out); |
c01a723 |
Jamozed |
2022-02-05 19:04:03 |
19
|
extern void rc2decrypt(struct rc2 *ctx, uint8_t *in, uint8_t *out); |
03b01d2 |
Jamozed |
2022-03-06 17:10:01 |
20
|
|
03b01d2 |
Jamozed |
2022-03-06 17:10:01 |
21
|
#ifdef __cplusplus |
03b01d2 |
Jamozed |
2022-03-06 17:10:01 |
22
|
} // extern "C" |
03b01d2 |
Jamozed |
2022-03-06 17:10:01 |
23
|
#endif |
c01a723 |
Jamozed |
2022-02-05 19:04:03 |
24
|
|
c01a723 |
Jamozed |
2022-02-05 19:04:03 |
25
|
#endif // UTIL_RC2_H_PMXL29JH |
|
|
|
26
|
|