raw
smg_comms_rsa_oaep      1  -- True Random octets generator reading from an FG and using Raw_Types.
smg_comms_rsa_oaep 2 -- S.MG, 2018
smg_comms_rsa_oaep 3
smg_comms_rsa_oaep 4 with Ada.Sequential_IO;
smg_comms_rsa_oaep 5 with Interfaces;
smg_comms_rsa_oaep 6 with Raw_Types;
smg_comms_rsa_oaep 7
smg_comms_rsa_oaep 8 package RNG is
smg_comms_rsa_oaep 9
smg_comms_rsa_oaep 10 -- for reading from the FG one Octet at a time
smg_comms_rsa_oaep 11 package Octet_IO is new Ada.Sequential_IO(Element_Type =>
smg_comms_rsa_oaep 12 Interfaces.Unsigned_8);
smg_comms_rsa_oaep 13
smg_comms_rsa_oaep 14 -- path to the FG; NB: the FG has to be initialized prior to using SMG Comms!
smg_comms_rsa_oaep 15 RNG_PATH: constant String := "/dev/ttyUSB0";
smg_comms_rsa_oaep 16
smg_comms_rsa_oaep 17 -- exception raised when FG is not accessible / read fails
smg_comms_rsa_oaep 18 FG_Failure : exception;
smg_comms_rsa_oaep 19
smg_comms_rsa_oaep 20 -- reads O'Length octets from the FG at RNG_PATH
smg_comms_rsa_oaep 21 procedure Get_Octets( O: out Raw_Types.Octets );
smg_comms_rsa_oaep 22 end RNG;