-
+ AD406F2A69515E600B7B4986232EB5AD88C0A058F3CDB24981044389A88A5A30C92F198B5431F59D38149AB99E8C893FE6657A7D940F51EA4B28ED0D113C46D0
smg_comms/src/packing.ads
(0 . 0)(1 . 31)
93 -- Packing/unpacking for Eulora's communication protocol:
94 -- Serpent Message to/from Serpent Packet
95 -- RSA Message to/from RSA Packet
96 -- S.MG, 2018
97
98 with Raw_Types;
99 with Serpent;
100
101 package Packing is
102 -- no side effects or internal state
103 Pragma Pure(Packing);
104
105 -- Packing a Serpent message into Serpent package, using the given key
106 function Pack( Msg : in Raw_Types.Serpent_Msg;
107 K : in Serpent.Key )
108 return Raw_Types.Serpent_Pkt;
109
110 -- Unpacking a Serpent packet into contained message, using the given key
111 function Unpack( Pkt : in Raw_Types.Serpent_Pkt;
112 K : in Serpent.Key)
113 return Raw_Types.Serpent_Msg;
114
115 -- internals of this package, NOT for outside use
116 private
117 -- length of 1 Serpent block
118 Block_Len: constant Natural := Serpent.Block'Length;
119
120 -- number of Serpent blocks in one single Serpent message/packet
121 S_Blocks : constant Natural := Raw_Types.SERPENT_OCTETS / Block_Len;
122
123 end Packing;