toSecretKey method

SchnorrkelSecretKey toSecretKey([
  1. ExpansionMode mode = ExpansionMode.ed25519
])

Converts the SchnorrkelSecretKey into a full secret key using a specified expansion mode.

The expansion mode determines how the mini-secret key is expanded into a Schnorrkel secret key.

Parameters:

  • mode (optional): The expansion mode for converting the mini-secret key. Default is ExpansionMode.ed25519.

Returns: A SchnorrkelSecretKey instance representing the full secret key.

Example Usage:

SchnorrkelSecretKey miniSecretKey = ...;
SchnorrkelSecretKey secretKey = miniSecretKey.toSecretKey(ExpansionMode.ed25519);

The toSecretKey method allows the conversion of a mini-secret key into a full Schnorrkel secret key using the specified expansion mode, which can be either ExpansionMode.ed25519 or ExpansionMode.uniform. Depending on the mode chosen, a different expansion method is applied.

Implementation

SchnorrkelSecretKey toSecretKey(
    [ExpansionMode mode = ExpansionMode.ed25519]) {
  if (mode == ExpansionMode.ed25519) {
    return _expandEd25519();
  }
  return _expandUniform();
}