tree checksum vpatch file split hunks

all signers: diana_coman

antecedents: smg_comms_packing_serpent smg_comms_rsa_oaep

press order:

smg_comms_genesisdiana_coman
smg_comms_raw_typesdiana_coman
smg_comms_packing_serpentdiana_coman
smg_comms_c_wrappersdiana_coman
smg_comms_rsa_oaepdiana_coman
smg_comms_packing_rsadiana_coman

patch:

- 094D9668C13448F4869AB21BF0779D36675D26FA4648585BD73E9A661AA0F936DD440D9B2DD523D8D363C143FC4F6F9B4BBB20F4F7F7C05067B4F3992D3B7461
+ 093BE13909EE7CD2A1A381C45A35E93CE3D7491987ADF948FF44E5D94E201CE78410D6CB72B67B046979E45AAA6B20EE05079F30A922467ED6BD7F76F28217E1
smg_comms/manifest
(3 . 3)(3 . 4)
5 546152 smg_comms_packing_serpent diana_coman Packing/Unpacking Serpent messages <-> Serpent packets. Includes Serpent implementation.
6 547275 smg_comms_c_wrappers diana_coman C wrappers for RSA and MPI methods that are needed by SMG Comms (so that they can be called from Ada using only arrays of octets as inputs/outputs).
7 547983 smg_comms_rsa_oaep diana_coman RSA with OAEP from ADA using the c_wrappers for RSA only. It includes reading from FG in Ada and repeat of OAEP until first octet is < first octet of key's modulus (i.e. without going through MPI for comparison).
8 548433 smg_comms_packing_rsa diana_coman Packing/Unpacking RSA messages <-> RSA packets of Eulora's communication protocol.
- 53945EA441AF37B53C009C3B31826BB688CBA5525176D55ED76B934FA34702A86E31041CF4D125FA9FC827C41C242A06E472A0AD2D80FB33DDA9F9AB08260458
+ 294BA38D9E97BE1B0F63D96BA294EF5628CEE71001C683024322CA7F7DC086A885BC91DED97D96CAC045DAA944F535DDA3775B36CF8B017F693F31BDE1994775
smg_comms/src/keccak.adb
(218 . 6)(218 . 9)
13 Y := 0;
14
15 for T in 0..23 loop
16 -- NB: the mod op forces an implicit conditional (check against div 0)
17 -- If No_Implicit_Conditionals restriction is desired,
18 -- replace mod Z_Length with and (Z_Length - 1 )
19 Output(X, Y) := Rotate_Left(Input(X,Y), ((T+1)*(T+2)/2) mod Z_Length);
20 Old_Y := Y;
21 Y := 2*X + 3*Y;
- 982B3D71F5AE114ABC3A8A5C754E0F645D62694BEDEF479DEC7D51DDC454AC23F19EDF27526B2F1A5D91A73EE0111C2761C29551E5C6894D4844660E2981717C
+ EFEAAA4C7DFD3875BD71A32327E798AAAC33550E1205F0E929DD0B6ED66A46DFA2D4546B2281B5E6FF67C495ACB13B86F74C5FF7C0ADBA628BDC58C74344D159
smg_comms/src/oaep.adb
(45 . 7)(45 . 7)
26 M00( M00'First + 1) := Unsigned_8( ( (MsgLen * 8 ) / 256 ) mod 256 );
27
28 -- next 8 octets are reserved for later use, currently "TMSR-RSA"
29 M00( M00'First + 3 .. M00'First + 10 ) := TMSR;
30 M00( M00'First + 3 .. M00'First + 10 ) := Raw_Types.OAEP_RESERVED;
31
32 -- random bits for padding, if Msg is less than maximum length
33 for I in 1 .. PadLen loop
- C4D51B3D41CA323C78B1C7A591B002A59FC756A1D895041DD2D3DDF4F2F2FCB60714C65E6A338949D8CE2AC5EF2BCCCB1365C97842E013849707CEFA4E633A4B
+ 1DF6E427D9A484501633259AC37AE404CABD5A7513447CA85DAF349DA205D5F70DEDB59486D1A868561A22FFC02D5E70CB05198C412E7BEEF7F926A5CF6A8A21
smg_comms/src/oaep.ads
(15 . 11)(15 . 9)
38 OAEP_LENGTH_OCTETS : constant := Raw_Types.RSA_KEY_OCTETS;
39 OAEP_LENGTH_BITS : constant := OAEP_LENGTH_OCTETS * 8;
40 OAEP_HALF_OCTETS : constant := OAEP_LENGTH_OCTETS / 2;
41 TMSR_STR : constant String := "TMSR-RSA";
42 TMSR_STR : constant String := Raw_Types.OAEP_R_STR;
43 -- "TMSR-RSA" as unsigned_8 values:
44 TMSR : constant Raw_Types.Octets := (84,77,83,82,45,82,83,65);
45 MAX_LEN_MSG : constant Natural := OAEP_HALF_OCTETS -
46 TMSR_STR'Length - 3;
47 MAX_LEN_MSG : constant := Raw_Types.OAEP_MAX_LEN;
48
49 -- subtypes for OAEP encrypt/decrypt
50 subtype OAEP_Block is Raw_Types.Octets( 1 .. OAEP_LENGTH_OCTETS );
- 9650F68C8BFBA99299B059E943008CE5C682B3991E60EA7EE51C22F23373B56A9C1BD1C6459F5D7F8A5553244A4656C357035CF54CAECAC4CBCAB25041B2C011
+ 35A028DE1F46C6B81DB6159697DF6A2CD170ACADF60CBB5CA01880206BF59B34D6F9FE8199B77120FC680D882BCC2DEC0D21EE552FE76AF5686CBC02A418397C
smg_comms/src/packing.adb
(74 . 4)(74 . 86)
55 return Msg;
56 end Unpack;
57
58 -- Packing a RSA message into RSA packet, using the given key
59 function Pack( Msg : in Raw_Types.RSA_Msg;
60 K : in RSA_OAEP.RSA_pkey)
61 return Raw_Types.RSA_Pkt is
62
63 -- a chunk that can be processed via rsa+oaep at any given time
64 Chunk: Raw_Types.Octets(1..Raw_Types.OAEP_MAX_LEN) := (others => 0);
65
66 -- number of chunks in the message to process
67 -- NO incomplete chunks will be processed!
68 -- NB: values are set so that there are no incomplete blocks here
69 N : constant Natural := Msg'Length / Chunk'Length;
70
71 -- intermediate result, as obtained from rsa_oaep
72 Encr: Raw_Types.RSA_len := (others => 0);
73
74 -- final resulting RSA Packet
75 Pkt : Raw_Types.RSA_Pkt := (others => 0);
76 begin
77 -- there should ALWAYS be precisely N chunks in Msg to feed to rsa_oaep
78 -- process chunks of Msg one at a time
79 for I in 1..N loop
80 -- get current chunk
81 Chunk := Msg(Msg'First + (I-1) * Chunk'Length ..
82 Msg'First + I * Chunk'Length - 1 );
83 -- call rsa oaep encrypt on current chunk
84 RSA_OAEP.Encrypt( Chunk, K, Encr );
85 -- copy result to its place in final packet
86 Pkt( Pkt'First + (I-1) * Encr'Length ..
87 Pkt'First + I * Encr'Length - 1 ) := Encr;
88 end loop;
89 -- return final result
90 return Pkt;
91 end Pack;
92
93 -- Unpacking a RSA packet into contained message, using the given key
94 function Unpack( Pkt : in Raw_Types.RSA_Pkt;
95 K : in RSA_OAEP.RSA_skey;
96 Success : out Boolean)
97 return Raw_Types.RSA_Msg is
98 -- a chunk - basically input for RSA_OAEP.Decrypt
99 Chunk : Raw_Types.RSA_len := (others => 0);
100
101 -- intermediate result of rsa_oaep decrypt
102 Decr : Raw_Types.Octets( 1..Raw_Types.OAEP_MAX_LEN ) := (others => 0);
103 Len : Natural;
104 Flag : Boolean;
105
106 -- number of chunks in the packet
107 -- NB: there should be only FULL chunks! otherwise -> fail
108 N : constant Natural := Pkt'Length / Chunk'Length;
109
110 -- final resulting message content of the given RSA packet
111 Msg : Raw_Types.RSA_Msg := (others => 0);
112 begin
113 -- initialize Success flag
114 Success := True;
115
116 -- process given packet, chunk by chunk
117 for I in 1..N loop
118 -- get current chunk
119 Chunk := Pkt( Pkt'First + (I-1) * Chunk'Length ..
120 Pkt'First + I * Chunk'Length - 1 );
121 -- decrypt it via rsa+oaep
122 RSA_OAEP.Decrypt( Chunk, K, Decr, Len, Flag );
123 -- check result and if ok then copy it to final result at its place
124 -- NB: if returned length is EVER less than OAEP_MAX_LEN then -> fail!
125 -- the reason for above: there will be undefined bits in the output!
126 if Len /= Raw_Types.OAEP_MAX_LEN or (not Flag) then
127 Success := False;
128 return Msg;
129 else
130 Msg( Msg'First + (I-1) * Decr'Length ..
131 Msg'First + I * Decr'Length - 1 ) := Decr;
132 end if;
133 end loop;
134
135 -- return obtained message
136 return Msg;
137 end Unpack;
138
139
140 end Packing;
- AD406F2A69515E600B7B4986232EB5AD88C0A058F3CDB24981044389A88A5A30C92F198B5431F59D38149AB99E8C893FE6657A7D940F51EA4B28ED0D113C46D0
+ 1ABD8B4C0B1DC937F181A72C6BE60886D6739239FED88204046D674C1F63206D37F338FD055F16DA09FF9EEDF2EC4DA6E8FB19D63683737AECE44C0498E72E60
smg_comms/src/packing.ads
(5 . 21)(5 . 33)
145
146 with Raw_Types;
147 with Serpent;
148 with RSA_OAEP;
149
150 package Packing is
151 -- no side effects or internal state
152 Pragma Pure(Packing);
153 -- no side effects or internal state BUT it depends on non-pure:
154 -- rsa_oaep because it uses rng (exceptions and sequential_io)
155
156 -- Packing a Serpent message into Serpent package, using the given key
157 -- Packing a Serpent message into Serpent packet, using the given key
158 function Pack( Msg : in Raw_Types.Serpent_Msg;
159 K : in Serpent.Key )
160 return Raw_Types.Serpent_Pkt;
161 K : in Serpent.Key )
162 return Raw_Types.Serpent_Pkt;
163
164 -- Unpacking a Serpent packet into contained message, using the given key
165 function Unpack( Pkt : in Raw_Types.Serpent_Pkt;
166 K : in Serpent.Key)
167 K : in Serpent.Key)
168 return Raw_Types.Serpent_Msg;
169
170 -- Packing a RSA message into RSA packet, using the given key
171 function Pack( Msg : in Raw_Types.RSA_Msg;
172 K : in RSA_OAEP.RSA_pkey)
173 return Raw_Types.RSA_Pkt;
174
175 -- Unpacking a RSA packet into contained message, using the given key
176 function Unpack( Pkt : in Raw_Types.RSA_Pkt;
177 K : in RSA_OAEP.RSA_skey;
178 Success : out Boolean)
179 return Raw_Types.RSA_Msg;
180
181 -- internals of this package, NOT for outside use
182 private
183 -- length of 1 Serpent block
- 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 );
- 27BBB5C117F46558F9F220E460E66C340D340E1D5315EC372B6C7765D709B22E56277A21712643CBCF8DB468752F5A22A7E9D832150A4B32B1C343B69ED24B20
+ AA23A7DCA5D7DB80C185AB5C81D4E3645D3A32CE795559DC6C057806BA4928D1C56B0528FC45578DFB0AE69152B290ABC591EB86931B59E1A862ADF7AD480AE5
smg_comms/tests/test_packing.adb
(3 . 7)(3 . 9)
241
242 with Packing; use Packing;
243 with Raw_Types; use Raw_Types;
244 with RSA_OAEP; use RSA_OAEP;
245 with Serpent; use Serpent;
246 with RNG; use RNG;
247
248 with Interfaces; use Interfaces;
249 with Ada.Text_IO; use Ada.Text_IO;
(19 . 7)(21 . 7)
251 New_Line;
252 end Print;
253
254 procedure Test_Pack_Unpack is
255 procedure Test_Pack_Unpack_Serpent is
256 InMsg : Serpent_Msg := (others => 0);
257 OutMsg : Serpent_Msg := (others => 0);
258
(50 . 6)(52 . 7)
260 Plain := InMsg((J-1)*Block'Length + 1 .. J*Block'Length);
261 Serpent.Encrypt(KS, Plain, Encr);
262 if Encr /= OutPkt((J-1)*Block'Length + 1 .. J*Block'Length) then
263 Put_Line("FAIL: pack/unpack with Serpent.");
264 raise Test_Error;
265 end if;
266 end loop;
(57 . 7)(60 . 73)
268 -- iterate, re-packing as "message" the previous package
269 InMsg := OutPkt;
270 end loop;
271
272 end Test_Pack_Unpack;
273
274 Put_Line("PASS: test pack/unpack with Serpent.");
275 end Test_Pack_Unpack_Serpent;
276
277 procedure Test_Pack_Unpack_RSA is
278 Msg : RSA_Msg;
279 Decr_Msg : RSA_Msg;
280 PKey : RSA_pkey;
281 SKey : RSA_skey;
282 Success : Boolean;
283 Pkt : RSA_Pkt;
284 n: String := "C6579F8646180EED0DC1F02E0DDD2B43EABB3F702D79D9928E2CDA5E1D42DF5D9ED7773F80B1F8D9B0DB7D4D00F55647640D70768F63D3CED56A39C681D08D6191F318BB79DC969B470A7364D53335C8318EF35E39D5DF706AB6F2393C6DD2128C142DBAB1806EB35E26C908F0A48419313D2D0F33DD430655DBFEC722899EC21C238E8DB7003430BBC39BAD990F9887F6B03E1344F537EC97389B78DBC656718ACD7B0FDC13DD24534F417BC7A18F077A0C4227354CEA19670331B6CAA3DFC17BBA7E70C14510D9EB3B63F3014994EC87BD23E868C0AE6E9EC55027577F62C0280B2D7DD1135001844923E5455C4566E066B3FDE968C6BC4DC672F229FCE366440403D7A4F4A8BFBA5679B7D0844BA1231277D13A77C9E2B5A1CB138C1B7AB5B4D4832448723A3DE70ED2E86D5FC5174F949A02DE8E404304BEB95F9BF40F3AA3CA15622D2776294BE7E19233406FF563CB8C25A1CB5AADBC1899DA3F2AE38533931FE032EE3232C2CD4F219FADF95B91635C0762A476A4DE5013F4384093F0FB715028D97F93B2E6F057B99EE344D83ADF2686FD5C9C793928BEF3182E568C4339C36C744C8E9CA7D4B9A16AA039CBF6F38CC97B12D87644E94C9DBD6BC93A93A03ED61ECC5874586E3A310E958F858735E30019D345C62E5127B80652C8A970A14B31F03B3A157CD5";
285 e: String := "F74D78E382FC19B064411C6C20E0FDB2985F843007A54C7D8400BB459468624126E7D175F397E55C57AF25858EAE2D2952FB7998C119A6103606733EB5E1D27FCA1FACF14ADE94101D383D1B25DA511805569BC344EAD384EDBF3F3A541B34887FE199D99D7F62E6E9D516F88D6F5AD3E020DF04D402A02CC628A0064362FE8516CF7CD6040E9521407AB90EE6B5AFFF9EA9EBB16A7D3407CE81FD3844F519880556AB94AB349C1F3BBB6FDB4C4B377FE4C091EBDC2C3A1BD3AA56382D8D80E7742B5C751008FD6ECDD2EC3B2E3B6C566F698ED672000B403766DD63C3ACBDE16A14FB02E83A2EB6AA018BFC0020401E790DEE24E9";
286 d: String := "698DA05DA25B230211EEF0CBA12083A1457B749A11937AC9993859F69A3BF38D575E5166AF2EC88D77F1DF04E68AEA358EACF7659FD4722A4F5A1C8BA7676DA97A9FBA75451152F8F68887D3451A9CCFFFE9EB80979786E37495B17687A6212F77FA616E4C0CD8A8EB7AEB88EA6CCABB7F3E854FB94B35394A09F95F0D6F997947E865CC0606F437C30FE8C48D96FBF5E2F52807BC9E9ED7BBEB23D5C45EDDCD16FE2BF410A9A1E5EF879E71C0D41FAE270C0C5D442860103F8C3944E802F33DB38432F11F763A7AF593656108E4A98A44A8549913CE5DCEC1A6500F280E3190991B2B938561CFACD8BC5183AAC9A4914BFE52C3BE39BB83688E1DE52479107EF8E087DCDB409432FC954C6349407E81DDFB11AE92BABB32A31868597958C9C76E0B4156F380955F0E09C1F3B98BB4CDD59E1B5C7D8CC2AA7491B0D319D219CF459A527CE1AA2729DEC53269653BF0ED3E0253F4451168437E3B069E48350CA4C3EC82134E87135624C768D1330B0D70C6E447FD9945BF06FCB91AA334C0FD8EEF1ADBC15928B3DB62077B537F7E9F468CC95CD5AAFEAE1F760A863B48D07B163F670E2E5B550BB3E960230BA9FDAED9903AE2E669A7F3C4D1F1E25B8E8EDB8CC6E6FD2164E66F4E64ED77BEF1EC9E6CEA5624FD84C0680248746DC1C8187145F3CD2411659DAEAD11D";
287 p: String := "CDD6F7673A501FB24C44D56CA1D434F6CB3334E193E02F8E906241906BCB7412DD2159825B24C22002F373E647C2DA62A854F3841C00FD5985D03227CA9B54A69380BA9D63BE738BDF9E65C247E43E1220EEDD9281DCA78B32A4E1B786B7697ED0C3195D5AF2990881B11D6FC9EC9F940067B2DEA2A516FAA5F269C98F0B67628A6D2708515A4A58041AA17A93E4C4DD95C85BC38351DDA1DCF3DFD91C505B22383132649CF9F9233852C7207075BCF43C71038F043F1EC53E9787FB051B7927D020903233C16897B993C8089D8464451F086E756CF20E46CE6ED4A6AC5C327A0AAFBECBAAFD177969E7C952C76A4F4E7C85BF7F63";
288 q: String := "F6ACF0790A250802C8D45DAC549CDBEF7806D5877A5DF0069136A458FAC4F0B0858060A873DA6355A965A064A0BC1BBB874872CD7ED89674AD407533041E74BCA317EC73597D335115523F61A05071E5ED81EE2A05331F65D4DC7A25AD7938B124CF03F49154B6693FB0B598B33ABDEF85C599A57A9B7347EAFF82638E1CBC28FCDFFF1FF04A18C2DBF3938395C2F8D1782B43D3A25EF7633B5DDAC89EFD3BAA64D976425A0891E00B876E9DE9FE4B6492B0EA8DFC7C8DEEC61721356EC816295B1BD9CD9DA3E30D2D90DC9CB3987F4BE042104900E036F3044A016749EF910CCFB9F377A90849B4CCCF4471A74E67EF6C814C9467";
289 u: String := "854B89ED10F52258D00D6B3FA7F1FD22752804668F51FF7806DB82E22CB8B3AA8448D9B8E9DB14D31A36AEC2BCFA89E341B7334D494E97ED8051244136192233332C4612D963E7B6AF2535FDB7FE97E28DDFEBDFB3E1AFC29D05DBDF37106A817D3AB1864C7F7F247982897EDA6A92BED47D9C68305CD170C7301ACEB05F8A6382E73CC7614B2D8D758669B3A99AB64114809254B0BE21F40341A5B48B9B032603B14875B87EB5E16603FD16552E146A0FC6964958DFC25AA9FFCCD1ED1F4DEAF9FBAA0D7357F5FF0803FEB9BA78E74AC6B3070F417CEC6CFC7A3CF1E305FC7B76B7ED71893999AF797B2EBDE41FE90F076CCEDBFB";
290 begin
291 -- initialize RSA key with values previously obtained from EuCrypt
292 Hex2Octets( n, SKey.n );
293 Hex2Octets( e, SKey.e );
294 Hex2Octets( d, SKey.d );
295 Hex2Octets( p, SKey.p );
296 Hex2Octets( q, SKey.q );
297 Hex2Octets( u, SKey.u );
298 -- copy n and e for public key
299 PKey.n := SKey.n;
300 PKey.e := SKey.e;
301 -- get random data for "message"
302 RNG.Get_Octets(Msg);
303
304 -- pack the message into corresponding packet
305 Pkt := Packing.Pack( Msg, PKey );
306 -- unpack and check the result
307 Decr_Msg := Packing.Unpack( Pkt, SKey, Success );
308 if (not Success) or (Decr_Msg /= Msg) then
309 Put_Line("FAIL: pack/unpack with RSA.");
310 else
311 Put_Line("PASS: pack/unpack with RSA.");
312 end if;
313
314 -- try to unpack a mangled package
315 Pkt(Pkt'First + 3) := Pkt(Pkt'First + 3) and 16#AB#;
316 Decr_Msg := (others => 0);
317 Decr_Msg := Packing.Unpack( Pkt, SKey, Success );
318 if Success then
319 Put_Line("FAIL: pack/unpack with RSA on mangled package.");
320 else
321 Put_Line("PASS: pack/unpack with RSA on mangled package.");
322 end if;
323
324 end Test_Pack_Unpack_RSA;
325
326 -- helper methods
327 procedure Hex2Octets( Hex: in String; O: out Raw_Types.Octets ) is
328 S : String := "16#AA#";
329 -- to make sure that input String has EVEN number of chars (ie full octets)
330 H : String(1..Hex'Length+Hex'Length mod 2) := (others=>'0');
331 begin
332 -- first char is 0 if needed to cover full octet...
333 H(H'Length-Hex'Length+1..H'Length) := Hex;
334 O := (others => 0);
335 for I in 0 .. H'Length/2-1 loop
336 S := "16#" & H(H'First + I*2 .. H'First + I*2 + 1) & "#";
337 O(O'Last - H'Length/2 + 1 + I) := Unsigned_8'Value(S);
338 end loop;
339 end Hex2Octets;
340
341
342 end Test_Packing;
- 2FFCA1D2B5811D3EC15095F73BC55207E4DE623978585C4D4E408CF881A7CA6A5E6D4BB9EF3CCD6888F74377CDEFD085C96314559A916200999BEE45ED61A6AE
+ 0B774F9947B49EC87836A030BA9AE0B8AD0C802DF3FAA23A00D1019BA4CEF610765F36CD7E36212EBDB80EE32691E39277A42C11F88E9B3FA949E1CAB6FA676F
smg_comms/tests/test_packing.ads
(9 . 5)(9 . 13)
347 -- utility method for printing an array of octets
348 procedure Print(Data: in Raw_Types.Octets; Msg: in String);
349
350 procedure Test_Pack_Unpack;
351 -- testing pack/unpack for Serpent
352 procedure Test_Pack_Unpack_Serpent;
353
354 -- testing pack/unpack for RSA
355 procedure Test_Pack_Unpack_RSA;
356
357 -- helper methods
358 procedure Hex2Octets( Hex: in String; O: out Raw_Types.Octets );
359
360 end Test_Packing;
- FAED716C9FF42CEDC9353EED11CAB82EE3BE11DA5C4AE417CDA49AB092D68CD74A773052881EA831296AEF905C7B22EE56A25886424219388E4457DCB99CF4FB
+ A980E689B22403C41481DF1D9C86740A75F1AE0B386BD2425AB75D4E4DC4397165A0E14F58BFD0B6FE20E02F75528014E3EA1A730F75507BB8343329DD7E2B6F
smg_comms/tests/test_rsa_oaep.adb
(14 . 7)(14 . 7)
365
366 procedure test_char_array is
367 S : String := OAEP.TMSR_STR;
368 O : Octets := OAEP.TMSR;
369 O : Octets := Raw_Types.OAEP_RESERVED;
370 A : char_array(0..O'Length-1) := (others => '0');
371 B : Octets(0..O'Length -1) := (others => 0);
372 Fail : Boolean := FALSE;
- B150853B3E031AA9D0656A19645C7701C6F2FE543F2BE6FEBDE1D8B07D80EB4C4B690CB68D26A77D04D4EC0B85B7AB700BD20D4C2714F0F154FC3B848016B0CA
+ 01DED6598577BF4FB8027BEAA9678239EF98F27ABB62E3C5739B9347E4A747A1107052A6F908C7B4D3603C8DB762B59AAAC9EFA6EBF64C8CFFE1287985D87BB6
smg_comms/tests/testall.adb
(7 . 9)(7 . 10)
377 procedure testall is
378 begin
379 Test_Serpent.Selftest;
380 Test_Packing.Test_Pack_Unpack;
381 Test_RSA_OAEP.test_char_array;
382 Test_RSA_OAEP.test_oaep;
383 Test_RSA_OAEP.test_rsa;
384 Test_RSA_OAEP.test_rsa_oaep;
385 Test_Packing.Test_Pack_Unpack_Serpent;
386 Test_Packing.Test_Pack_Unpack_RSA;
387 end testall;