libutil

C Utility Library
git clone http://git.omkov.net/libutil
Log | Tree | Refs | README | LICENCE | Download

libutil/src/rc2.h (27 lines, 601 B) -rw-r--r-- file download

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