Hi Simon,
Another fantastic effort and a wonderful example of forensic computer archaeology. Bravo Sir!
Having spent several weeks doing research and several days coding last August to come up with Enigma algorithms for a little PIC microcontroller, I can't imagine the effort required to understand and simulate the Bombe. My Enigma algorithms used two constant arrays for each rotor, that is, one array for data moving each way through the rotor (see code excerpt below).
I look forward to following your progress, Sir...
Cheerful regards, Mike
Code:
;******************************************************************
;
; the first 26 byte table for each rotor is for entering the
; rotor from the right side (the input side) and the second
; 26 byte table is for entering the rotor from the left (the
; reflector) side.
;
; index 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
; index A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
; -----------------------------------------------------------------------------
;
; 1930 Enigma I
;
ROT1 db 4,10,12, 5,11, 6, 3,16,21,25,13,19,14,22,24, 7,23,20,18,15, 0, 8, 1,17, 2, 9
; E K M F L G D Q V Z N T O W Y H X U S P A I B R C J
RET1 db 20,22,24, 6, 0, 3, 5,15,21,25, 1, 4, 2,10,12,19, 7,23,18,11,17, 8,13,16,14, 9
; U W Y G A D F P V Z B E C K M T H X S L R I N Q O J
;
; 1930 Enigma I
;
ROT2 db 0, 9, 3,10,18, 8,17,20,23, 1,11, 7,22,19,12, 2,16, 6,25,13,15,24, 5,21,14, 4
; A J D K S I R U X B L H W T M C Q G Z N P Y F V O E
RET2 db 0, 9,15, 2,25,22,17,11, 5, 1, 3,10,14,19,24,20,16, 6, 4,13, 7,23,12, 8,21,18
; A J P C Z W R L F B D K O T Y U Q G E N H X M I V S
;
; 1930 Enigma I
;
ROT3 db 1, 3, 5, 7, 9,11, 2,15,17,19,23,21,25,13,24, 4, 8,22, 6, 0,10,12,20,18,16,14
; B D F H J L C P R T X V Z N Y E I W G A K M U S Q 0
RET3 db 19, 0, 6, 1,15, 2,18, 3,16, 4,20, 5,21,13,25, 7,24, 8,23, 9,22,11,17,10,14,12
; T A G B P C S D Q E U F V N Z H Y I X J W L R K O M
;
; DEC 1938, M3 Army
;
ROT4 db 4,18,14,21,15,25, 9, 0,24,16,20, 8,17, 7,23,11,13, 5,19, 6,10, 3, 2,12,22, 1
; E S O V P Z J A Y Q U I R H X L N F T G K D C M W B
RET4 db 7,25,22,21, 0,17,19,13,11, 6,20,15,23,16, 2, 4, 9,12, 1,18,10, 3,24,14, 8, 5
; H Z W V A R T N L G U P X Q C E J M B S K D Y O I F
;
; DEC 1938, M3 Army
;
ROT5 db 21,25, 1,17, 6, 8,19,24,20,15,18, 3,13, 7,11,23, 0,22,12, 9,16,14, 5, 4, 2,10
; V Z B R G I T Y U P S D N H L X A W M J Q O F E C K
RET5 db 16, 2,24,11,23,22, 4,13, 5,19,25,14,18,12,21, 9,20, 3,10, 6, 8, 0,17,15, 7, 1
; Q C Y L X W E N F T Z O S M V J U D K G I A R P H B
;
; index 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
; index A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
; -----------------------------------------------------------------------------
;
; 1939 M3 & M4 Naval (FEB 1942)
;
ROT6 db 9,15, 6,21,14,20,12, 5,24,16, 1, 4,13, 7,25,17, 3,10, 0,18,23,11, 8, 2,19,22