- 57AD398331BF9B99C93592FCA3BDEFF7CA8EBFD630EC3FC142706498EB4A7DCB05F21520670D5945C26046237C7DE2C93E021801157B5BF8BF99308FB004D8E4
+ 57AE10788359BEC09CCF96403F641C0EC34C4152FC90CE172B93E4BC8C15E92A7C2248FCEEF9D6CB9CAA7FC929C239466CA99BB4209BDB5C21EA5EA1983B75D0
smg_comms/tests/io_rsa.ads
(7 . 13)(7 . 24)
400
401 package IO_RSA is
402
403 Incorrect_E_Len: exception;
404 Incorrect_D_Len: exception;
405
406 -- reads a full private key from specified file, in Hex format
407 -- one component per line, in order: n, e, d, p, q, u
408 -- NB: length of each component has to match *precisely* the expected length
409 -- e (public exponent) has the length given as argument
410 -- if E_Len < RSA_half'Length then e is stored 0-led in Key.e
411 -- if E_Len > RSA_half'Length then this will FAIL.
412 -- specifically, using Raw_Types:
413 -- n, d are RSA_len'Length*2;
414 -- e, p, q, u are RSA_half'Length*2
415 procedure ReadRSAKey( Filename: in String; Key: out RSA_OAEP.RSA_skey );
416 -- n is RSA_len'Length octets (so *2 chars read);
417 -- p, q, u are RSA_half'Length (so *2 chars read);
418 -- e is RSA_half'Length but E_Len_Chars chars will be read;
419 -- d is RSA_len'Length but D_Len_Chars chars will be read;
420 procedure ReadRSAKey( Filename : in String;
421 E_Len_Chars : in Positive;
422 D_Len_Chars : in Positive;
423 Key : out RSA_OAEP.RSA_skey );
424
425 -- convert hexadecimal strings to octets representation
426 procedure Hex2Octets( Hex: in String; O: out Raw_Types.Octets );