public static int CryptoBoxBeforenm(byte[] K, byte[] Pk, byte[] Sk) { byte[] s = new byte[32]; byte[] sp = s, sigmap = Xsalsa20.sigma; Curve25519.CryptoScalarmult(sp, Sk, Pk); return(Hsalsa20.CryptoCore(K, null, sp, sigmap)); }
public static int CryptoBoxKeypair(byte[] Pk, byte[] Sk) { new Random().NextBytes(Sk); return(Curve25519.CryptoScalarmultBase(Pk, Sk)); }
public static int CryptoBoxGetpublickey(byte[] Pk, byte[] Sk) { return(Curve25519.CryptoScalarmultBase(Pk, Sk)); }