Exemplo n.º 1
0
 public byte[] GenerateDerivedScryptKey(byte[] password, byte[] salt, int n, int r, int p, int dkLen, bool checkRandN = false)
 {
     if (checkRandN)
     {
         //The test vectors of Ethereum provides a cost bigger than the Scrypt spec of "N = less than 2 ^ (128 * r / 8)"
         //so we allow to do validation in general for encryption but not for decryption.
         if (r == 1 && n >= 65536)
         {
             throw new ArgumentException("Cost parameter N must be > 1 and < 65536.");
         }
     }
     return(SCrypt.Generate(password, salt, n, r, p, dkLen));
 }
Exemplo n.º 2
0
 public byte[] GenerateDerivedScryptKey(byte[] password, byte[] salt, int n, int r, int p, int dkLen)
 {
     return(SCrypt.Generate(password, salt, n, r, p, dkLen));
 }