Flipper Zero Firmware
Loading...
Searching...
No Matches
crypto1.h
1#pragma once
2
3#include <toolbox/bit_buffer.h>
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9typedef struct {
10 uint32_t odd;
11 uint32_t even;
12} Crypto1;
13
14Crypto1* crypto1_alloc(void);
15
16void crypto1_free(Crypto1* instance);
17
18void crypto1_reset(Crypto1* crypto1);
19
20void crypto1_init(Crypto1* crypto1, uint64_t key);
21
22uint8_t crypto1_bit(Crypto1* crypto1, uint8_t in, int is_encrypted);
23
24uint8_t crypto1_byte(Crypto1* crypto1, uint8_t in, int is_encrypted);
25
26uint32_t crypto1_word(Crypto1* crypto1, uint32_t in, int is_encrypted);
27
28void crypto1_decrypt(Crypto1* crypto, const BitBuffer* buff, BitBuffer* out);
29
30void crypto1_encrypt(Crypto1* crypto, uint8_t* keystream, const BitBuffer* buff, BitBuffer* out);
31
32void crypto1_encrypt_reader_nonce(
33 Crypto1* crypto,
34 uint64_t key,
35 uint32_t cuid,
36 uint8_t* nt,
37 uint8_t* nr,
38 BitBuffer* out,
39 bool is_nested);
40
41uint32_t prng_successor(uint32_t x, uint32_t n);
42
43#ifdef __cplusplus
44}
45#endif
Definition bit_buffer.c:7
Definition crypto1.h:9