-
+ 3CDEA9E53BC0897151E3EB45166AC209388C4704D212DD40E2EAFEFE2850F56128559E9F5BA33D696F0CC45D41685428A6FF4265890C86D49266E5C90BD3FE8Effa/ffacalc/ffa_rng.ads(0 . 0)(1 . 46)
162 ------------------------------------------------------------------------------
163 ------------------------------------------------------------------------------
164 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
165 -- --
166 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
167 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
168 -- --
169 -- You do not have, nor can you ever acquire the right to use, copy or --
170 -- distribute this software ; Should you use this software for any purpose, --
171 -- or copy and distribute it to anyone or in any manner, you are breaking --
172 -- the laws of whatever soi-disant jurisdiction, and you promise to --
173 -- continue doing so for the indefinite future. In any case, please --
174 -- always : read and understand any software ; verify any PGP signatures --
175 -- that you use - for any purpose. --
176 -- --
177 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
178 ------------------------------------------------------------------------------
179 ------------------------------------------------------------------------------
180
181 with Ada.Sequential_IO;
182
183 with Words; use Words;
184 with FZ_Type; use FZ_Type;
185
186
187 package FFA_RNG is
188
189 Default_RNG_Path : constant String := "/dev/random";
190
191 -- For reading from RNGs:
192 package Word_IO is new Ada.Sequential_IO(Element_Type => Word);
193
194 -- Represents an RNG Device:
195 type RNG_Device is record
196 F : Word_IO.File_Type;
197 end record;
198
199 -- Prepare an RNG for use; at given path, or will use default
200 procedure Init_RNG(RNG : out RNG_Device;
201 RNG_Unix_Path : in String := Default_RNG_Path);
202
203 -- Fill a FZ from RNG
204 procedure FZ_Random(RNG : in RNG_Device;
205 N : out FZ);
206
207 end FFA_RNG;