// Path: src/main/java/org/abstractj/kalium/NaCl.java
// public static Sodium sodium() {
//     Sodium sodium = SingletonHolder.SODIUM_INSTANCE;
//     checkVersion(sodium);
//     return sodium;
// }
// 
// Path: src/main/java/org/abstractj/kalium/encoders/Encoder.java
// public interface Encoder {
// 
//     public static final Charset CHARSET = Charset.forName("US-ASCII");
// 
//     public static final Hex HEX = new Hex();
//     public static final Raw RAW = new Raw();
// 
//     public byte[] decode(String data);
// 
//     public String encode(final byte[] data);
// }


import static org.abstractj.kalium.NaCl.Sodium.CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OUTBYTES;
import static org.abstractj.kalium.NaCl.Sodium.CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRBYTES;
import static org.abstractj.kalium.NaCl.sodium;
import org.abstractj.kalium.encoders.Encoder;
package org.abstractj.kalium.crypto;


public class Password {

    public Password() {
    }
    public byte[] deriveKey(int length, byte[] passwd, byte[] salt, int opslimit, long memlimit) {
        byte[] buffer = new byte[length];
// Path: src/main/java/org/abstractj/kalium/NaCl.java
// public static Sodium sodium() {
//     Sodium sodium = SingletonHolder.SODIUM_INSTANCE;
//     checkVersion(sodium);
//     return sodium;
// }
// 
// Path: src/main/java/org/abstractj/kalium/encoders/Encoder.java
// public interface Encoder {
// 
//     public static final Charset CHARSET = Charset.forName("US-ASCII");
// 
//     public static final Hex HEX = new Hex();
//     public static final Raw RAW = new Raw();
// 
//     public byte[] decode(String data);
// 
//     public String encode(final byte[] data);
// }


// Path: src/main/java/org/abstractj/kalium/crypto/Password.java
import static org.abstractj.kalium.NaCl.Sodium.CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OUTBYTES;
import static org.abstractj.kalium.NaCl.Sodium.CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRBYTES;
import static org.abstractj.kalium.NaCl.sodium;
import org.abstractj.kalium.encoders.Encoder;

package org.abstractj.kalium.crypto;


public class Password {

    public Password() {
    }
    public byte[] deriveKey(int length, byte[] passwd, byte[] salt, int opslimit, long memlimit) {
        byte[] buffer = new byte[length];
        sodium().crypto_pwhash_scryptsalsa208sha256(buffer, buffer.length, passwd, passwd.length, salt, opslimit, memlimit);