finished basic keygen
This commit is contained in:
parent
b2fda499bd
commit
989078b6cb
@ -14,8 +14,11 @@ namespace tests
|
||||
[Test]
|
||||
public void TestKeyGen()
|
||||
{
|
||||
System.Console.Write(chestcrypto.PrivateKeyGenerator.generate().Length);
|
||||
if (chestcrypto.PrivateKeyGenerator.generate().Length != 96){
|
||||
byte[] key = chestcrypto.PrivateKeyGenerator.generate();
|
||||
if (key.Length != 96){
|
||||
Assert.Fail();
|
||||
}
|
||||
if (key.Equals(chestcrypto.PrivateKeyGenerator.generate())){
|
||||
Assert.Fail();
|
||||
}
|
||||
Assert.Pass();
|
||||
|
@ -28,10 +28,13 @@ namespace chestcrypto{
|
||||
Buffer.BlockCopy(second, 0, bytes, first.Length, second.Length);
|
||||
return bytes;
|
||||
}
|
||||
public static byte[] generate(){
|
||||
public static byte[] generate()
|
||||
{
|
||||
byte[] ed25519 = Ed25519KeyGenerator.generator();
|
||||
byte[] curve25519 = Curve25519KeyGenerator.generator();
|
||||
byte[] key = Combine(ed25519, curve25519);
|
||||
Array.Clear(ed25519, 0, ed25519.Length);
|
||||
Array.Clear(curve25519, 0, curve25519.Length);
|
||||
return key;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user