-- S.MG, 2018 with Raw_Types; use Raw_Types; with Serpent; use Serpent; package body Test_Serpent is procedure Selftest is K : Key := (others => 0); P : Block := (others => 0); P2, C : Block; W : Key_Schedule; begin for I in 1 .. 128 loop Prepare_Key(K, W); Encrypt(W, P, C); Decrypt(W, C, P2); if (P2 /= P) then raise Implementation_Error; end if; P := K( 0 .. 15); K( 0 .. 15) := K(16 .. 31); K(16 .. 31) := C; end loop; if C /= (16#A2#, 16#46#, 16#AB#, 16#69#, 16#0A#, 16#E6#, 16#8D#, 16#FB#, 16#02#, 16#04#, 16#CB#, 16#E2#, 16#8E#, 16#D8#, 16#EB#, 16#7A#) then raise Implementation_Error; end if; end Selftest; end Test_Serpent;