-- Packing/unpacking for Eulora's communication protocol: -- Serpent Message to/from Serpent Packet -- RSA Message to/from RSA Packet -- S.MG, 2018 with Raw_Types; with Serpent; package Packing is -- no side effects or internal state Pragma Pure(Packing); -- Packing a Serpent message into Serpent package, using the given key function Pack( Msg : in Raw_Types.Serpent_Msg; K : in Serpent.Key ) return Raw_Types.Serpent_Pkt; -- Unpacking a Serpent packet into contained message, using the given key function Unpack( Pkt : in Raw_Types.Serpent_Pkt; K : in Serpent.Key) return Raw_Types.Serpent_Msg; -- internals of this package, NOT for outside use private -- length of 1 Serpent block Block_Len: constant Natural := Serpent.Block'Length; -- number of Serpent blocks in one single Serpent message/packet S_Blocks : constant Natural := Raw_Types.SERPENT_OCTETS / Block_Len; end Packing;