You are not logged in.
Pages: 1
Hi how can I assign to manually seed for TAESPRNG Random Generator ?
function GenRandom: integer;
var
prng:TAESPRNG;
begin
prng:=TAESPRNG.Create;
prng.Seed:=57454654; // ????????????
Result:= prng.Random64;
prng.Free;
end;
Last edited by Uefi (2024-11-08 23:29:04)
Offline
Seed is a procedure instead of a property. See it comments:
/// would force the internal generator to re-seed its private key
// - avoid potential attacks on backward or forward security
// - would be called by FillRandom() methods, according to SeedAfterBytes
// - this method is thread-safe
So, no need to set the SEED manually, just using those properties:
/// after how many generated bytes Seed method would be called
// - default is 32 MB - i.e. 21-bit CTR rounds which seems paranoid enough
// - if set to 0 - e.g. for TSystemPrng - no seeding will occur
property SeedAfterBytes: PtrUInt
read fSeedAfterBytes;
/// how many Pbkdf2HmacSha512 count is applied by Seed to the entropy
// - default is 16 rounds, which is more than enough for entropy gathering,
// since GetEntropy output comes from a SHAKE-256 generator in XOF mode
property SeedPbkdf2Round: cardinal
read fSeedPbkdf2Round;
/// the source of entropy used during seeding - faster gesUserOnly by default
property SeedEntropySource: TAesPrngGetEntropySource
read fSeedEntropySource;
Offline
Are you a fool? These properties are not assigned; they are read-only!
Offline
There is no point.
Use directly an AES-CTR generator with a fixed key and IV.
Or use mormot.core.base Lecuyer generator, which allows a 32-bit seed and is good enough as generator.
Hello, I tested Lecuyer, it doesn’t have the FillRandomHex I need like in TAESPRNG
Offline
Use Lecuyer + mormot.core.text for hexa.
If you can, please provide an example of the code, otherwise it’s not clear at all
Offline
Pages: 1