mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-09-11 22:17:18 +03:00
17 lines
459 B
Plaintext
17 lines
459 B
Plaintext
/*
|
|
* Copyright (c) 2013-2018 Galois, Inc.
|
|
* Distributed under the terms of the BSD3 license (see LICENSE file)
|
|
*/
|
|
|
|
type Char = [8]
|
|
type Permutation = String 26
|
|
|
|
invSubst : (String 26, Char) -> Char
|
|
invSubst (key, c) = candidates ! 0
|
|
where candidates = [0] # [ if c == k then a else p
|
|
| k <- key
|
|
| a <- ['A' .. 'Z']
|
|
| p <- candidates
|
|
]
|
|
|