mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-17 13:01:31 +03:00
22 lines
533 B
Plaintext
22 lines
533 B
Plaintext
|
|
// Cryptol Enigma Simulator
|
|
// Copyright (c) 2010-2013, Galois Inc.
|
|
// www.cryptol.net
|
|
// You can freely use this source code for educational purposes.
|
|
|
|
// Helper synonyms:
|
|
// type Char = [8]
|
|
module Enigma where
|
|
|
|
enigmaLoop : {n}(fin n) => [n]
|
|
enigmaLoop = undefined
|
|
|
|
// Encryption/Decryption
|
|
enigma : {n, m} (fin n, fin m) => ([n], [m]) -> [m]
|
|
enigma (m, pt) = tail [ True | _ <- rcs ]
|
|
where rcs = [ (m, True)] #
|
|
[ (enigmaLoop, True)
|
|
| _ <- pt
|
|
| (_,_) <- rcs
|
|
]
|