Is the logic for how the enigma machine worked documented somewhere?
Is the logic for how the enigma machine worked documented somewhere?


Yes!

If you're really interested in "diving in deeper" (pun intented), I would like to advise you to check out:


"The Cryptographic Mathematics of Enigma"
Dr. A. Ray Miller
NSA. Center for Cryptologic History. USA. 1996. 3rd edition 2002
"Funkpeilung als alliierte Waffe gegen Deutsche U-Boote 1939-1945."
Arthur Bauer
ISBN: 3-00-002142-6. The Netherlands, 1997. German. p. 33.