eucrypt_ch14_crc32 1
eucrypt_ch14_crc32 2
eucrypt_ch14_crc32 3
eucrypt_ch14_crc32 4
eucrypt_ch14_crc32 5
eucrypt_ch14_crc32 6
eucrypt_ch14_crc32 7
eucrypt_ch14_crc32 8
eucrypt_ch14_crc32 9
eucrypt_ch14_crc32 10
eucrypt_ch14_crc32 11
eucrypt_ch14_crc32 12
eucrypt_ch14_crc32 13
eucrypt_ch14_crc32 14
eucrypt_ch14_crc32 15
eucrypt_ch14_crc32 16
eucrypt_ch14_crc32 17
eucrypt_ch14_crc32 18
eucrypt_ch14_crc32 19
eucrypt_ch14_crc32 20 with Ada.Text_IO; use Ada.Text_IO;
eucrypt_ch14_crc32 21 with Interfaces; use Interfaces;
eucrypt_ch14_crc32 22 with CRC32;
eucrypt_ch14_crc32 23
eucrypt_ch14_crc32 24 procedure Test_CRC32 is
eucrypt_ch14_crc32 25 Input : constant String := "123456789";
eucrypt_ch14_crc32 26 Expected : constant Unsigned_32 := 16#CBF4_3926#;
eucrypt_ch14_crc32 27 Output : Unsigned_32;
eucrypt_ch14_crc32 28 begin
eucrypt_ch14_crc32 29 Output := CRC32.CRC(Input);
eucrypt_ch14_crc32 30 if Output /= Expected then
eucrypt_ch14_crc32 31 Put_Line("FAIL: CRC32(" & Input & ") returned " &
eucrypt_ch14_crc32 32 Unsigned_32'Image(Output) & " instead of " &
eucrypt_ch14_crc32 33 Unsigned_32'Image(Expected));
eucrypt_ch14_crc32 34 else
eucrypt_ch14_crc32 35 Put_Line("PASS: CRC32(" & Input & ") returned " &
eucrypt_ch14_crc32 36 Unsigned_32'Image(Output) & " as expected.");
eucrypt_ch14_crc32 37 end if;
eucrypt_ch14_crc32 38
eucrypt_ch14_crc32 39 end Test_CRC32;