From ea99441e0da927e5a40cf21311265c7e22974f12 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Mon, 13 Feb 2017 13:21:17 +1100 Subject: Preference dedupe removed, bignum library obtained from internet (will be replaced later) --- src/crypto-types-random_source-file.ads | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/crypto-types-random_source-file.ads (limited to 'src/crypto-types-random_source-file.ads') diff --git a/src/crypto-types-random_source-file.ads b/src/crypto-types-random_source-file.ads new file mode 100644 index 0000000..8a3e960 --- /dev/null +++ b/src/crypto-types-random_source-file.ads @@ -0,0 +1,50 @@ +with Ada.Streams.Stream_IO; +with Ada.Strings.Unbounded; + +package Crypto.Types.Random_Source.File is + package Rnd renames Crypto.Types.Random_Source; + + type Random_Source_File is new Rnd.Random_Source with private; + type Random_Source_File_Access is access Random_Source_File; + + Overriding + procedure Finalize(This : in out Random_Source_File); + + Overriding + procedure Initialize(This : in out Random_Source_File); + + procedure Initialize(This : in out Random_Source_File; + File_Path : in String); + Overriding + procedure Read(This : in out Random_Source_File; B : out Byte); + + Overriding + procedure Read(This : in out Random_Source_File; Byte_Array : out Bytes); + + Overriding + procedure Read(This : in out Random_Source_File; B : out B_Block128); + + Overriding + procedure Read(This : in out Random_Source_File; W : out Word); + + Overriding + Procedure Read(This : in out Random_Source_File; Word_Array : out Words); + + Overriding + procedure Read(This : in out Random_Source_File; D : out DWord); + + Overriding + procedure Read(This : in out Random_Source_File; DWord_Array : out DWords); +private + type File_Access is access Ada.Streams.Stream_IO.File_Type; + + type Random_Source_File is new Rnd.Random_Source with + record + Source_Path : Ada.Strings.Unbounded.Unbounded_String; + Source_File : File_Access; + end record; + + function Path_Starts_With(This : Random_Source_File; S : String) + return Boolean; + +end Crypto.Types.Random_Source.File; -- cgit