1 /* enc.h */ 2 3 /* 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 8 #ifndef ENC_H 9 #define ENC_H 10 11 #include <zephyr/sys/printk.h> 12 13 #define WHEEL_SIZE 26 14 #define IMOD(a, b) ((a + b) % WHEEL_SIZE) 15 16 #ifndef BYTE 17 #define BYTE unsigned char 18 #endif 19 20 void update_wheel_index(void); 21 char index_to_char(short i); 22 short char_to_index(char c); 23 int calc_rev_wheel(BYTE *wheel, BYTE *backpath); 24 char enig_enc(char pt); 25 26 extern volatile BYTE W1[26]; 27 extern volatile BYTE W2[26]; 28 extern volatile BYTE W3[26]; 29 extern volatile BYTE R[26]; 30 extern volatile BYTE W1R[26]; 31 extern volatile BYTE W2R[26]; 32 extern volatile BYTE W3R[26]; 33 extern volatile int IW1; 34 extern volatile int IW2; 35 extern volatile int IW3; 36 37 #endif 38