-
+ 38B3AD90AD37EC9A14B57C0634DAB6440AEE690D8F3454394585CCA13BDA9FEB1C6ECEAD74CDDC17D829D6AC6AD6E588F620FDB8A658287208D19379C38774F3
eucrypt/smg_serpent/src/smg_serpent.ads
(0 . 0)(1 . 48)
705 -------------------------------------------------------------------------------
706 -- S.MG, 2018; with added automated tests
707 --
708 -- Serpent Blockcipher
709 --
710 -- Copyright (c) 1998 Markus G. Kuhn <mkuhn@acm.org>. All rights reserved.
711 --
712 -- $Id: serpent.ads,v 1.2 1998-06-10 14:22:16+00 mgk25 Exp $
713 --
714 -------------------------------------------------------------------------------
715 --
716 -- This is the Ada95 reference implementation of the Serpent cipher
717 -- submitted by Ross Anderson, Eli Biham and Lars Knudson in June 1998 to
718 -- the NIST Advanced Encryption Standard (AES) contest. Please note that
719 -- this is a revised algorithm that is not identical to the old version
720 -- presented at the 1998 Fast Software Encryption Workshop.
721 -- <http://www.cs.technion.ac.il/~biham/Reports/Serpent/>
722 --
723 -- Compiled with GNAT 3.10p under Linux, this implementation encrypts and
724 -- decrypts with 20.8 Mbit/s on a 300 MHz Pentium II.
725 --
726 -------------------------------------------------------------------------------
727
728 with Interfaces; use Interfaces;
729
730 package SMG_Serpent is
731
732 pragma Pure(SMG_Serpent);
733
734 type Bytes is array (Integer range <>) of Unsigned_8;
735 type Words is array (Integer range <>) of Unsigned_32;
736 subtype Block is Bytes (0 .. 15);
737 subtype Key is Bytes (0 .. 31);
738 subtype Key_Schedule is Words (-8 .. 131);
739
740 procedure Prepare_Key (K : in Key; W : out Key_Schedule);
741
742 procedure Encrypt (W : in Key_Schedule; Plaintext : in Block;
743 Ciphertext : out Block);
744
745 procedure Decrypt (W : in Key_Schedule; Ciphertext : in Block;
746 Plaintext : out Block);
747
748 procedure Selftest;
749
750 Implementation_Error : exception; -- raised if Selftest failed
751
752 end SMG_Serpent;