raw
smg_comms_packing...    1   -- Packing/unpacking for Eulora's communication protocol:
smg_comms_packing... 2 -- Serpent Message to/from Serpent Packet
smg_comms_packing... 3 -- RSA Message to/from RSA Packet
smg_comms_packing... 4 -- S.MG, 2018
smg_comms_packing... 5
smg_comms_packing... 6 with Raw_Types;
smg_comms_packing... 7 with Serpent;
smg_comms_packing... 8
smg_comms_packing... 9 package Packing is
smg_comms_packing... 10 -- no side effects or internal state
smg_comms_packing... 11 Pragma Pure(Packing);
smg_comms_packing... 12
smg_comms_packing... 13 -- Packing a Serpent message into Serpent package, using the given key
smg_comms_packing... 14 function Pack( Msg : in Raw_Types.Serpent_Msg;
smg_comms_packing... 15 K : in Serpent.Key )
smg_comms_packing... 16 return Raw_Types.Serpent_Pkt;
smg_comms_packing... 17
smg_comms_packing... 18 -- Unpacking a Serpent packet into contained message, using the given key
smg_comms_packing... 19 function Unpack( Pkt : in Raw_Types.Serpent_Pkt;
smg_comms_packing... 20 K : in Serpent.Key)
smg_comms_packing... 21 return Raw_Types.Serpent_Msg;
smg_comms_packing... 22
smg_comms_packing... 23 -- internals of this package, NOT for outside use
smg_comms_packing... 24 private
smg_comms_packing... 25 -- length of 1 Serpent block
smg_comms_packing... 26 Block_Len: constant Natural := Serpent.Block'Length;
smg_comms_packing... 27
smg_comms_packing... 28 -- number of Serpent blocks in one single Serpent message/packet
smg_comms_packing... 29 S_Blocks : constant Natural := Raw_Types.SERPENT_OCTETS / Block_Len;
smg_comms_packing... 30
smg_comms_packing... 31 end Packing;