Libgcrypt requires initialization before first use. The functions init
and init_fips
can be
used to initialize the library. The closure passed to these functions is used to configure the
library. More information on configuration options can be found in the libgcrypt
documentation.
An example:
let gcrypt = gcrypt::init(|x| {
x.disable_secmem();
Ok::<_, ()>(())
});
Calling any function in the wrapper that requires initialization before init
or init_fips
are called will cause the wrapper to attempt to initialize the library with a default
configuration.