bn_gencb_st class final

bn_gencb_st, or |BN_GENCB|, holds a callback function that is used by generation functions that can take a very long time to complete. Use |BN_GENCB_set| to initialise a |BN_GENCB| structure.

The callback receives the address of that |BN_GENCB| structure as its last argument and the user is free to put an arbitrary pointer in |arg|. The other arguments are set as follows:

  • event=BN_GENCB_GENERATED, n=i: after generating the i'th possible prime number.
  • event=BN_GENCB_PRIME_TEST, n=-1: when finished trial division primality checks.
  • event=BN_GENCB_PRIME_TEST, n=i: when the i'th primality test has finished.

The callback can return zero to abort the generation progress or one to allow it to continue.

When other code needs to call a BN generation function it will often take a BN_GENCB argument and may call the function with other argument values.

Inheritance
Implemented types
Available extensions

Constructors

bn_gencb_st()

Properties

address → Pointer<T>

Available on T, provided by the StructAddress extension

The memory address of the underlying data.
no setter
arg ↔ Pointer<Void>
callback-specific data
getter/setter pair
callback ↔ Pointer<NativeFunction<Int Function(Int, Int, Pointer<BN_GENCB>)>>
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

$allocate(Allocator $allocator, {required Pointer<Void> arg, required Pointer<NativeFunction<Int Function(Int, Int, Pointer<BN_GENCB>)>> callback}) → Pointer<BN_GENCB>