Exemple #1
0
 /// <summary>
 /// Calculate key pair from the key seed.
 /// </summary>
 /// <param name="publicKey">
 /// Public key
 /// </param>
 /// <param name="expandedPrivateKey">
 /// Expanded form of the private key
 /// </param>
 /// <param name="privateKeySeed">
 /// Private key seed value
 /// </param>
 public static void KeyPairFromSeed(ArraySegment <byte> publicKey, ArraySegment <byte> expandedPrivateKey,
                                    ArraySegment <byte> privateKeySeed)
 {
     Ed25519Operations.CryptoSignKeyPair(
         publicKey.Array, publicKey.Offset,
         expandedPrivateKey.Array, expandedPrivateKey.Offset,
         privateKeySeed.Array, privateKeySeed.Offset);
 }
Exemple #2
0
        /// <summary>
        /// Calculate key pair from the key seed.
        /// </summary>
        /// <param name="publicKey">
        /// Public key
        /// </param>
        /// <param name="expandedPrivateKey">
        /// Expanded form of the private key
        /// </param>
        /// <param name="privateKeySeed">
        /// Private key seed value
        /// </param>
        public static void KeyPairFromSeed(out byte[] publicKey, out byte[] expandedPrivateKey, byte[] privateKeySeed)
        {
            var pk = new byte[PublicKeySize];
            var sk = new byte[ExpandedPrivateKeySize];

            Ed25519Operations.CryptoSignKeyPair(pk, 0, sk, 0, privateKeySeed, 0);
            publicKey          = pk;
            expandedPrivateKey = sk;
        }