smg_comms_skeys_s... 1
smg_comms_skeys_s... 2
smg_comms_skeys_s... 3
smg_comms_skeys_s... 4
smg_comms_skeys_s... 5
smg_comms_skeys_s... 6
smg_comms_skeys_s... 7
smg_comms_skeys_s... 8
smg_comms_skeys_s... 9
smg_comms_skeys_s... 10
smg_comms_skeys_s... 11
smg_comms_skeys_s... 12
smg_comms_skeys_s... 13
smg_comms_skeys_s... 14
smg_comms_skeys_s... 15
smg_comms_skeys_s... 16
smg_comms_skeys_s... 17
smg_comms_skeys_s... 18
smg_comms_skeys_s... 19
smg_comms_skeys_s... 20 package body CRC32 is
smg_comms_skeys_s... 21 function CRC( S: in String ) return CRC32 is
smg_comms_skeys_s... 22 Result : CRC32 := Init_Value;
smg_comms_skeys_s... 23 Value : CRC32;
smg_comms_skeys_s... 24 begin
smg_comms_skeys_s... 25
smg_comms_skeys_s... 26 for C of S loop
smg_comms_skeys_s... 27 Value := CRC32( Character'Pos( C ) );
smg_comms_skeys_s... 28 Result := Shift_Right(Result, 8) xor
smg_comms_skeys_s... 29 Lookup( Value xor (Result and LSB_MASK));
smg_comms_skeys_s... 30 end loop;
smg_comms_skeys_s... 31
smg_comms_skeys_s... 32 Result := Result xor Xor_Out;
smg_comms_skeys_s... 33
smg_comms_skeys_s... 34 return Result;
smg_comms_skeys_s... 35 end CRC;
smg_comms_skeys_s... 36
smg_comms_skeys_s... 37 function CRC( Data: in Octet_Array ) return CRC32 is
smg_comms_skeys_s... 38 Result : CRC32 := Init_Value;
smg_comms_skeys_s... 39 begin
smg_comms_skeys_s... 40
smg_comms_skeys_s... 41 for C of Data loop
smg_comms_skeys_s... 42 Result := Shift_Right(Result, 8) xor
smg_comms_skeys_s... 43 Lookup( CRC32(C) xor (Result and LSB_MASK));
smg_comms_skeys_s... 44 end loop;
smg_comms_skeys_s... 45
smg_comms_skeys_s... 46 Result := Result xor Xor_Out;
smg_comms_skeys_s... 47
smg_comms_skeys_s... 48 return Result;
smg_comms_skeys_s... 49 end CRC;
smg_comms_skeys_s... 50
smg_comms_skeys_s... 51 end CRC32;
smg_comms_skeys_s... 52