1 PACKAGE FND_RANDOM_NUMBER AUTHID CURRENT_USER AS
2 /* $Header: AFSCRNGS.pls 115.3 2004/04/20 21:06:23 dehu noship $ */
3 --
4 -- Note to developers:
5 -- Please do not directly use the APIs in this package. Use the
6 -- APIs in FND_CRYPTO. These APIs are internal to AOL.
7 --
8 --
9 -- Reseed the random generator from stored entropy
10 -- Note: in-transaction, caller must commit or rollback
11 --
12 procedure RESEED_GENERATOR;
13
14 --
15 -- Initialize the generator by getting the key and counter
16 -- Note: performs autonomous transaction if table update is needed
17 --
18 procedure INITIALIZE_GENERATOR;
19
20 --
21 -- Get a random value as a 16-byte raw value (by calling GET_RANDOM_BYTES).
22 --
23 function GET_RANDOM return raw;
24
25 --
26 -- Get a random set of bytes (from 1-2000 as specified).
27 -- Returns null if an invalid byte count is specified.
28 -- If necessary, (re)initializes the generator.
29 -- Throws some entropy into the in-memory pools
30 --
31 function GET_RANDOM_BYTES(P_NBYTES in number default null) return raw;
32
33 --
34 -- Add some entropy to the in-memory pools
35 -- Automatically flushes the entropy to the table after a certain amount
36 -- is collected.
37 --
38 procedure ADD_ENTROPY(P_ENTROPY in raw default null);
39
40 --
41 -- Flush any accumulated entropy to the table
42 -- Automatically reseeds the generator if enough entropy is available
43 -- Note: commits as an autonomous transaction
44 --
45 procedure FLUSH_ENTROPY;
46
47
48 --
49 -- Can be invoked to bootstrap the generator with external entropy
50 -- DO NOT INVOKE THIS WITHOUT CONSULTING ATG SECURITY
51 --
52 procedure ADD_EXTERNAL_ENTROPY(P_E in raw default null);
53
54 end FND_RANDOM_NUMBER;