57 lines
973 B
C++
57 lines
973 B
C++
/*
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/cppFiles/file.h to edit this template
|
|
*/
|
|
|
|
/*
|
|
* File: Enigma.h
|
|
* Author: ale
|
|
*
|
|
* Created on 6 mai 2026, 14:17
|
|
*/
|
|
|
|
#ifndef ENIGMA_H
|
|
#define ENIGMA_H
|
|
|
|
#include <Arduino.h>
|
|
#include <cstring>
|
|
#define BUFFER_SIZE 100
|
|
|
|
class Enigma {
|
|
|
|
public:
|
|
// Constructeur
|
|
Enigma();
|
|
|
|
// Destructeur
|
|
~Enigma();
|
|
|
|
void init();
|
|
char encode(char car);
|
|
char *getChiffre();
|
|
|
|
private:
|
|
char rotate(char *rot);
|
|
int getCharRotor(char *rotIn,char* rotOut,int indexCar);
|
|
int getReflector(char *refl,int indexCar);
|
|
|
|
char rotorHautIn[27];
|
|
char rotorHautOut[27];
|
|
|
|
char rotorMilieuIn[27];
|
|
char rotorMilieuOut[27];
|
|
|
|
char rotorBasIn[27];
|
|
char rotorBasOut[27];
|
|
|
|
char reflector[27];
|
|
char buffer[BUFFER_SIZE];
|
|
int ptrbuf;
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* ENIGMA_H */
|
|
|