- 86ACC0069CA2466F40782BD7C7643B97B465D520FCAC61479A7E401FD1A2FC9A8D51360D94AAD997A3E91265BD98555BFCC5A8453AD0CA352F0E2300729E0C52
+ AF8D8AEF6AF31A1E9B664ED49AA62785576DE0526849596269EC46EDE622C474756FB58AC151A26C93484913881AFDEDD3A069D4327CBC741D6F0C62FED9238D
smg_comms/src/raw_types.ads
(12 . 6)(12 . 10)
188 -- no side effects or internal state
189 Pragma Pure(Raw_Types);
190
191 -- raw, low-level type
192 -- all messages and packets are simply arrays of octets at low level/raw
193 type Octets is array( Natural range <> ) of Interfaces.Unsigned_8;
194
195 -- constants from SMG.COMMS standard specification
196
197 -- RSA key size in octets
(21 . 22)(25 . 29)
199 -- a. it's C code that should import this, not the other way around.
200 -- b. it needs to be static here.
201 RSA_KEY_OCTETS : constant Positive := 490;
202
203 -- OAEP constants: defined here as still part of standard spec.
204 -- OAEP package will use those values when using Raw_Types
205 -- (NOT the other way around since dependency is oaep on types.)
206 OAEP_R_STR : constant String := "TMSR-RSA";
207 -- "TMSR-RSA" as unsigned_8 values:
208 OAEP_RESERVED : constant Octets := (84,77,83,82,45,82,83,65);
209 -- max length of useful payload in a OAEP-encrypted entity
210 OAEP_MAX_LEN : constant Natural := RSA_KEY_OCTETS / 2 -
211 OAEP_R_STR'Length - 3;
212
213 -- size of a RSA-encrypted packet and message in octets and bits
214 RSA_PKT_OCTETS : constant Positive := 1470;
215 RSA_MSG_OCTETS : constant Positive := RSA_PKT_OCTETS /
216 RSA_KEY_OCTETS *
217 OAEP_MAX_LEN;
218 RSA_MSG_BITS : constant Positive := RSA_MSG_OCTETS * 8;
219
220 -- size of a serpent-encrypted packet and message, in octets
221 -- note that this corresponds to 1472/16 = 92 Serpent blocks
222 -- NB: lengths are the same!
223 SERPENT_OCTETS : constant Positive := 1472;
224
225 -- size of a RSA-encrypted packet and message in octets and bits
226 RSA_PKT_OCTETS : constant Positive := 1470;
227 RSA_MSG_OCTETS : constant Positive := 234;
228 RSA_MSG_BITS : constant Positive := RSA_MSG_OCTETS * 8; --1872
229
230 -- raw, low-level types
231 -- all messages and packets are simply arrays of octets at low level/raw
232 type Octets is array( Natural range <> ) of Interfaces.Unsigned_8;
233
234 -- raw representations of basic types (with fixed, well-defined sizes)
235 subtype Octets_1 is Octets( 1 .. 1 );
236 subtype Octets_2 is Octets( 1 .. 2 );