/*
* Neuroxiq 2022
* Arctium Project / Code example
*
*
*/
using Arctium.Shared.Helpers.Buffers;
using Arctium.Standards.EllipticCurves;
namespace ConsoleAppTest
{
internal class MainProgram
{
private static byte[] bobPrivateKey;
private static byte[] bobPublicKey;
private static byte[] alicePrivateKey;
private static byte[] alicePublicKey;
static void Main()
{
BobGenerateKeyPair();
AliceGenerateKeyPair();
BobComputeSharedSecret();
AliceComputeSharedSecret();
}
private static void AliceComputeSharedSecret()
{
byte[] sharedSecret = RFC7748.X448(alicePrivateKey, bobPublicKey);
Console.WriteLine("Alice shared secret: ");
MemDump.HexDump(sharedSecret);
}
private static void BobComputeSharedSecret()
{
byte[] sharedSecret = RFC7748.X448(bobPrivateKey, alicePublicKey);
Console.WriteLine("Bob shared secret: ");
MemDump.HexDump(sharedSecret);
}
private static void AliceGenerateKeyPair()
{
RFC7748.X448_GeneratePrivateAndPublicKey(out alicePrivateKey, out alicePublicKey);
}
private static void BobGenerateKeyPair()
{
RFC7748.X448_GeneratePrivateAndPublicKey(out bobPrivateKey, out bobPublicKey);
}
}
}
/*
*/