sig
type g
exception Unseeded_generator
module S :
sig
module type Generator =
sig
type g
val block : int
val create : unit -> Nocrypto.Rng.S.Generator.g
val generate : g:Nocrypto.Rng.S.Generator.g -> int -> Cstruct.t
val reseed : g:Nocrypto.Rng.S.Generator.g -> Cstruct.t -> unit
val accumulate :
g:Nocrypto.Rng.S.Generator.g ->
(source:int -> Cstruct.t -> unit) Nocrypto.Uncommon.one
val seeded : g:Nocrypto.Rng.S.Generator.g -> bool
end
module type N =
sig
type t
val gen :
?g:Nocrypto.Rng.g -> Nocrypto.Rng.S.N.t -> Nocrypto.Rng.S.N.t
val gen_r :
?g:Nocrypto.Rng.g ->
Nocrypto.Rng.S.N.t -> Nocrypto.Rng.S.N.t -> Nocrypto.Rng.S.N.t
val gen_bits :
?g:Nocrypto.Rng.g -> ?msb:int -> int -> Nocrypto.Rng.S.N.t
end
end
module Generators :
sig
module Fortuna : S.Generator
module Hmac_drgb :
sig module Make : functor (H : Hash.S) -> S.Generator end
module Null : S.Generator
end
val create :
?g:'a ->
?seed:Cstruct.t ->
?strict:bool ->
(module Nocrypto.Rng.S.Generator with type g = 'a) -> Nocrypto.Rng.g
val generator : Nocrypto.Rng.g Pervasives.ref
val generate : ?g:Nocrypto.Rng.g -> int -> Cstruct.t
val block : Nocrypto.Rng.g option -> int
val reseed : ?g:Nocrypto.Rng.g -> Cstruct.t -> unit
val accumulate :
Nocrypto.Rng.g option ->
(source:int -> Cstruct.t -> unit) Nocrypto.Uncommon.one
val seeded : Nocrypto.Rng.g option -> bool
module Make_N :
functor (N : Numeric.S) ->
sig
type t = N.t
val gen : ?g:g -> t -> t
val gen_r : ?g:g -> t -> t -> t
val gen_bits : ?g:g -> ?msb:int -> int -> t
end
module Int :
sig
type t = int
val gen : ?g:g -> t -> t
val gen_r : ?g:g -> t -> t -> t
val gen_bits : ?g:g -> ?msb:int -> int -> t
end
module Int32 :
sig
type t = int32
val gen : ?g:g -> t -> t
val gen_r : ?g:g -> t -> t -> t
val gen_bits : ?g:g -> ?msb:int -> int -> t
end
module Int64 :
sig
type t = int64
val gen : ?g:g -> t -> t
val gen_r : ?g:g -> t -> t -> t
val gen_bits : ?g:g -> ?msb:int -> int -> t
end
module Z :
sig
type t = Z.t
val gen : ?g:g -> t -> t
val gen_r : ?g:g -> t -> t -> t
val gen_bits : ?g:g -> ?msb:int -> int -> t
end
val prime : ?g:Nocrypto.Rng.g -> ?msb:int -> int -> Nocrypto.Rng.Z.t
val safe_prime :
?g:Nocrypto.Rng.g -> int -> Nocrypto.Rng.Z.t * Nocrypto.Rng.Z.t
type buffer = Cstruct.t
end