Skip to content

Instantly share code, notes, and snippets.

@hierophantos
Created December 31, 2018 23:29
Show Gist options
  • Save hierophantos/ecb57c5861e426258f4dcd06ff7ae47c to your computer and use it in GitHub Desktop.
Save hierophantos/ecb57c5861e426258f4dcd06ff7ae47c to your computer and use it in GitHub Desktop.
||| key schedule
KS : DEAKey -> Vect 16 (Bits 48)
KS key = map PC2
(tail (scanl (\prevKey, shift =>
concat (map (rotateLeft shift)
(partition {m=28} {n=2} prevKey)))
(PC1 key)
[1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment