-
+ 3DC03A39E5FAF220021E2AD7A0C6E1E59B98CFD2F3B3D81AAD065632268BB091077EE74BA4E3138EDD4594BF562ACAA68D6E5A150E56F5E4C3EFF992F1702981
smg_comms/src/serpent.ads
(0 . 0)(1 . 44)
788 -------------------------------------------------------------------------------
789 -- S.MG, 2018;
790 --
791 -- Serpent Blockcipher
792 --
793 -- Copyright (c) 1998 Markus G. Kuhn <mkuhn@acm.org>. All rights reserved.
794 --
795 --
796 -------------------------------------------------------------------------------
797 --
798 -- This is the Ada95 reference implementation of the Serpent cipher
799 -- submitted by Ross Anderson, Eli Biham and Lars Knudson in June 1998 to
800 -- the NIST Advanced Encryption Standard (AES) contest. Please note that
801 -- this is a revised algorithm that is not identical to the old version
802 -- presented at the 1998 Fast Software Encryption Workshop.
803 -- <http://www.cs.technion.ac.il/~biham/Reports/Serpent/>
804 --
805 -- Compiled with GNAT 3.10p under Linux, this implementation encrypts and
806 -- decrypts with 20.8 Mbit/s on a 300 MHz Pentium II.
807 --
808 -------------------------------------------------------------------------------
809
810 with Interfaces; use Interfaces;
811 with Raw_Types;
812
813 package Serpent is
814
815 pragma Pure(Serpent);
816
817 subtype Bytes is Raw_Types.Octets;
818 type Words is array (Integer range <>) of Unsigned_32;
819 subtype Block is Bytes (0 .. 15);
820 subtype Key is Bytes (0 .. 31);
821 subtype Key_Schedule is Words (-8 .. 131);
822
823 procedure Prepare_Key (K : in Key; W : out Key_Schedule);
824
825 procedure Encrypt (W : in Key_Schedule; Plaintext : in Block;
826 Ciphertext : out Block);
827
828 procedure Decrypt (W : in Key_Schedule; Ciphertext : in Block;
829 Plaintext : out Block);
830
831 end Serpent;