enigma

A library for simulating the Enigma machines.

Members

Aliases

EnigmaD
alias EnigmaD = Enigma!(3, false, false, true)

Enigma D, which has three rotor slots and no plugboard. The reflector can be set to any positions.

EnigmaI
alias EnigmaI = Enigma!3

Enigma I 'Wehrmacht', which has three rotor slots.

EnigmaM3
alias EnigmaM3 = Enigma!3

Enigma M3, which has three rotor slots.

EnigmaM4
alias EnigmaM4 = Enigma!(4, true)

Enigma M4, which has four rotor slots. The fourth rotor never rotates.

SwissK
alias SwissK = EnigmaD

Swiss K, which has three rotor slots and no plugboard. The reflector can be set to any positions.

reflectorK
alias reflectorK = reflectorD

Predefined existent reflectors.

Functions

entryWheel
auto entryWheel(S backwardSubstitution)

A convenience function to make an entry wheel from a substitution.

entryWheelABC
auto entryWheelABC()

Predefined the simplest entry wheel which does not substitute.

entryWheelQWE
auto entryWheelQWE()

Predefined entry wheel: QWE... -> ABC...

plugboard
auto plugboard(S substitution)

A convenience function to make a plugboard from a substitution.

plugboardDoNothing
auto plugboardDoNothing()

Predefined the simplest plugboard which does not substitute.

reflector
auto reflector(S substitution, dchar ringSetting)

A convenience function to make a reflector from a substitution.

reflectorA
auto reflectorA()

Predefined existent reflectors.

reflectorB
auto reflectorB()
Undocumented in source. Be warned that the author may not have intended to support it.
reflectorBThin
auto reflectorBThin()
reflectorC
auto reflectorC()
reflectorCThin
auto reflectorCThin()
reflectorD
auto reflectorD(dchar ringSetting)

Predefined existent reflectors.

rotor
auto rotor(S forwardSubstitution, dchar ringSetting)

A convenience function to make a rotor with no turnover notches from a forward substitution. If ringSetting is 'C', it corresponds to "C-03".

rotor
auto rotor(S forwardSubstitution, dchar turnover, dchar ringSetting)

A convenience function to make a rotor with one turnover notch from a forward substitution. If turnover is 'B', the next rotor steps when this rotor steps from B to C. If ringSetting is 'C', it corresponds to "C-03".

rotor
auto rotor(S forwardSubstitution, dchar turnover1, dchar turnover2, dchar ringSetting)

A convenience function to make a rotor with two turnover notches from a forward substitution. If turnover1 is 'B' and turnover2 is 'Z', the next rotor steps when this rotor steps from B to C and from Z to A. If ringSetting is 'C', it corresponds to "C-03".

rotorBeta
auto rotorBeta(dchar ringSetting)
rotorGamma
auto rotorGamma(dchar ringSetting)

Predefined existent rotors. Because these rotors have no turnover notches, they are generally set side by side with a reflector.

rotorI
auto rotorI(dchar ringSetting)
rotorID
auto rotorID(dchar ringSetting)
rotorII
auto rotorII(dchar ringSetting)
rotorIID
auto rotorIID(dchar ringSetting)
rotorIII
auto rotorIII(dchar ringSetting)
rotorIIID
auto rotorIIID(dchar ringSetting)
rotorIIIK
auto rotorIIIK(dchar ringSetting)
rotorIIK
auto rotorIIK(dchar ringSetting)
rotorIK
auto rotorIK(dchar ringSetting)
rotorIV
auto rotorIV(dchar ringSetting)
rotorV
auto rotorV(dchar ringSetting)
rotorVI
auto rotorVI(dchar ringSetting)
rotorVII
auto rotorVII(dchar ringSetting)
rotorVIII
auto rotorVIII(dchar ringSetting)

Predefined existent rotors.

Structs

Enigma
struct Enigma(size_t rotorN, bool fixedFinalRotor = false, bool hasPlugboard = true, bool settableReflectorPos = false)

Currently machines with the double-stepping mechanism are available.

EntryWheel
struct EntryWheel
Plugboard
struct Plugboard
Reflector
struct Reflector
Rotor
struct Rotor

Meta

Authors

Kazuya Takahashi