示例#1
0
        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));
        }
示例#2
0
 public static int CryptoBoxKeypair(byte[] Pk, byte[] Sk)
 {
     new Random().NextBytes(Sk);
     return(Curve25519.CryptoScalarmultBase(Pk, Sk));
 }
示例#3
0
 public static int CryptoBoxGetpublickey(byte[] Pk, byte[] Sk)
 {
     return(Curve25519.CryptoScalarmultBase(Pk, Sk));
 }