Java 类org.bouncycastle.crypto.DerivationFunction 实例源码

项目:ipack    文件:ECIESKeyEncapsulation.java   
/**
 * Set up the ECIES-KEM.
 *
 * @param kdf             the key derivation function to be used.
 * @param rnd             the random source for the session key.
 * @param cofactorMode    true to use the new cofactor ECDH.
 * @param oldCofactorMode true to use the old cofactor ECDH.
 * @param singleHashMode  true to use single hash mode.
 */
public ECIESKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd,
    boolean cofactorMode,
    boolean oldCofactorMode,
    boolean singleHashMode)
{
    this.kdf = kdf;
    this.rnd = rnd;

    // If both cofactorMode and oldCofactorMode are set to true
    // then the implementation will use the new cofactor ECDH 
    this.CofactorMode = cofactorMode;
    this.OldCofactorMode = oldCofactorMode;
    this.SingleHashMode = singleHashMode;
}
项目:gwt-crypto    文件:ECIESKeyEncapsulation.java   
/**
 * Set up the ECIES-KEM.
 *
 * @param kdf             the key derivation function to be used.
 * @param rnd             the random source for the session key.
 * @param cofactorMode    true to use the new cofactor ECDH.
 * @param oldCofactorMode true to use the old cofactor ECDH.
 * @param singleHashMode  true to use single hash mode.
 */
public ECIESKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd,
    boolean cofactorMode,
    boolean oldCofactorMode,
    boolean singleHashMode)
{
    this.kdf = kdf;
    this.rnd = rnd;

    // If both cofactorMode and oldCofactorMode are set to true
    // then the implementation will use the new cofactor ECDH 
    this.CofactorMode = cofactorMode;
    this.OldCofactorMode = oldCofactorMode;
    this.SingleHashMode = singleHashMode;
}
项目:gwt-crypto    文件:MGF1GeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    byte[]             seed,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(new MGFParameters(seed));

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("MGF1 failed generator test " + count);
    }
}
项目:gwt-crypto    文件:KDF1GeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    byte[]             seed,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(new ISO18033KDFParameters(seed));

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("KDF1 failed generator test " + count);
    }
}
项目:gwt-crypto    文件:DHKEKGeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    DerivationParameters params,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(params);

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("DHKEKGenerator failed generator test " + count);
    }
}
项目:gwt-crypto    文件:ECDHKEKGeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    DerivationParameters params,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(params);

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("ECDHKEKGenerator failed generator test " + count);
    }
}
项目:gwt-crypto    文件:KDF2GeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    byte[]             seed,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(new KDFParameters(seed, new byte[0]));

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("KDF2 failed generator test " + count);
    }
}
项目:Aki-SSL    文件:ECIESKeyEncapsulation.java   
/**
 * Set up the ECIES-KEM.
 *
 * @param kdf             the key derivation function to be used.
 * @param rnd             the random source for the session key.
 * @param cofactorMode    true to use the new cofactor ECDH.
 * @param oldCofactorMode true to use the old cofactor ECDH.
 * @param singleHashMode  true to use single hash mode.
 */
public ECIESKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd,
    boolean cofactorMode,
    boolean oldCofactorMode,
    boolean singleHashMode)
{
    this.kdf = kdf;
    this.rnd = rnd;

    // If both cofactorMode and oldCofactorMode are set to true
    // then the implementation will use the new cofactor ECDH 
    this.CofactorMode = cofactorMode;
    this.OldCofactorMode = oldCofactorMode;
    this.SingleHashMode = singleHashMode;
}
项目:TinyTravelTracker    文件:ECIESKeyEncapsulation.java   
/**
 * Set up the ECIES-KEM.
 *
 * @param kdf             the key derivation function to be used.
 * @param rnd             the random source for the session key.
 * @param cofactorMode    true to use the new cofactor ECDH.
 * @param oldCofactorMode true to use the old cofactor ECDH.
 * @param singleHashMode  true to use single hash mode.
 */
public ECIESKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd,
    boolean cofactorMode,
    boolean oldCofactorMode,
    boolean singleHashMode)
{
    this.kdf = kdf;
    this.rnd = rnd;

    // If both cofactorMode and oldCofactorMode are set to true
    // then the implementation will use the new cofactor ECDH 
    this.CofactorMode = cofactorMode;
    this.OldCofactorMode = oldCofactorMode;
    this.SingleHashMode = singleHashMode;
}
项目:CryptMeme    文件:ECIESKeyEncapsulation.java   
/**
 * Set up the ECIES-KEM.
 *
 * @param kdf             the key derivation function to be used.
 * @param rnd             the random source for the session key.
 * @param cofactorMode    true to use the new cofactor ECDH.
 * @param oldCofactorMode true to use the old cofactor ECDH.
 * @param singleHashMode  true to use single hash mode.
 */
public ECIESKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd,
    boolean cofactorMode,
    boolean oldCofactorMode,
    boolean singleHashMode)
{
    this.kdf = kdf;
    this.rnd = rnd;

    // If both cofactorMode and oldCofactorMode are set to true
    // then the implementation will use the new cofactor ECDH 
    this.CofactorMode = cofactorMode;
    this.OldCofactorMode = oldCofactorMode;
    this.SingleHashMode = singleHashMode;
}
项目:irma_future_id    文件:ECIESKeyEncapsulation.java   
/**
 * Set up the ECIES-KEM.
 *
 * @param kdf             the key derivation function to be used.
 * @param rnd             the random source for the session key.
 * @param cofactorMode    true to use the new cofactor ECDH.
 * @param oldCofactorMode true to use the old cofactor ECDH.
 * @param singleHashMode  true to use single hash mode.
 */
public ECIESKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd,
    boolean cofactorMode,
    boolean oldCofactorMode,
    boolean singleHashMode)
{
    this.kdf = kdf;
    this.rnd = rnd;

    // If both cofactorMode and oldCofactorMode are set to true
    // then the implementation will use the new cofactor ECDH 
    this.CofactorMode = cofactorMode;
    this.OldCofactorMode = oldCofactorMode;
    this.SingleHashMode = singleHashMode;
}
项目:irma_future_id    文件:MGF1GeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    byte[]             seed,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(new MGFParameters(seed));

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("MGF1 failed generator test " + count);
    }
}
项目:irma_future_id    文件:KDF1GeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    byte[]             seed,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(new ISO18033KDFParameters(seed));

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("KDF1 failed generator test " + count);
    }
}
项目:irma_future_id    文件:DHKEKGeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    DerivationParameters params,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(params);

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("DHKEKGenerator failed generator test " + count);
    }
}
项目:irma_future_id    文件:ECDHKEKGeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    DerivationParameters params,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(params);

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("ECDHKEKGenerator failed generator test " + count);
    }
}
项目:irma_future_id    文件:KDF2GeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    byte[]             seed,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(new KDFParameters(seed, new byte[0]));

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("KDF2 failed generator test " + count);
    }
}
项目:bc-java    文件:ECIESKeyEncapsulation.java   
/**
 * Set up the ECIES-KEM.
 *
 * @param kdf             the key derivation function to be used.
 * @param rnd             the random source for the session key.
 * @param cofactorMode    true to use the new cofactor ECDH.
 * @param oldCofactorMode true to use the old cofactor ECDH.
 * @param singleHashMode  true to use single hash mode.
 */
public ECIESKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd,
    boolean cofactorMode,
    boolean oldCofactorMode,
    boolean singleHashMode)
{
    this.kdf = kdf;
    this.rnd = rnd;

    // If both cofactorMode and oldCofactorMode are set to true
    // then the implementation will use the new cofactor ECDH 
    this.CofactorMode = cofactorMode;
    this.OldCofactorMode = oldCofactorMode;
    this.SingleHashMode = singleHashMode;
}
项目:bc-java    文件:MGF1GeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    byte[]             seed,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(new MGFParameters(seed));

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("MGF1 failed generator test " + count);
    }
}
项目:bc-java    文件:KDF1GeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    byte[]             seed,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(new ISO18033KDFParameters(seed));

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("KDF1 failed generator test " + count);
    }
}
项目:bc-java    文件:DHKEKGeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    DerivationParameters params,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(params);

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("DHKEKGenerator failed generator test " + count);
    }
}
项目:bc-java    文件:ECDHKEKGeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    DerivationParameters params,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(params);

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("ECDHKEKGenerator failed generator test " + count);
    }
}
项目:bc-java    文件:KDF2GeneratorTest.java   
private void checkMask(
    int                count,
    DerivationFunction kdf,
    byte[]             seed,
    byte[]             result)
{
    byte[]             data = new byte[result.length];

    kdf.init(new KDFParameters(seed, new byte[0]));

    kdf.generateBytes(data, 0, data.length);

    if (!areEqual(result, data))
    {
        fail("KDF2 failed generator test " + count);
    }
}
项目:ipack    文件:IESEngine.java   
/**
 * set up for use with stream mode, where the key derivation function
 * is used to provide a stream of bytes to xor with the message.
 *
 * @param agree the key agreement used as the basis for the encryption
 * @param kdf   the key derivation function used for byte generation
 * @param mac   the message authentication code generator for the message
 */
public IESEngine(
    BasicAgreement agree,
    DerivationFunction kdf,
    Mac mac)
{
    this.agree = agree;
    this.kdf = kdf;
    this.mac = mac;
    this.macBuf = new byte[mac.getMacSize()];
    this.cipher = null;
}
项目:ipack    文件:IESEngine.java   
/**
 * set up for use in conjunction with a block cipher to handle the
 * message.
 *
 * @param agree  the key agreement used as the basis for the encryption
 * @param kdf    the key derivation function used for byte generation
 * @param mac    the message authentication code generator for the message
 * @param cipher the cipher to used for encrypting the message
 */
public IESEngine(
    BasicAgreement agree,
    DerivationFunction kdf,
    Mac mac,
    BufferedBlockCipher cipher)
{
    this.agree = agree;
    this.kdf = kdf;
    this.mac = mac;
    this.macBuf = new byte[mac.getMacSize()];
    this.cipher = cipher;
}
项目:ipack    文件:RSAKeyEncapsulation.java   
/**
 * Set up the RSA-KEM.
 *
 * @param kdf the key derivation function to be used.
 * @param rnd the random source for the session key.
 */
public RSAKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd)
{
    this.kdf = kdf;
    this.rnd = rnd;
}
项目:ipack    文件:ECIESKeyEncapsulation.java   
/**
 * Set up the ECIES-KEM.
 *
 * @param kdf the key derivation function to be used.
 * @param rnd the random source for the session key.
 */
public ECIESKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd)
{
    this.kdf = kdf;
    this.rnd = rnd;
    this.CofactorMode = false;
    this.OldCofactorMode = false;
    this.SingleHashMode = false;
}
项目:ipack    文件:KeyAgreementSpi.java   
protected KeyAgreementSpi(
    String kaAlgorithm,
    BasicAgreement agreement,
    DerivationFunction kdf)
{
    this.kaAlgorithm = kaAlgorithm;
    this.agreement = agreement;
    this.kdf = kdf;
}
项目:gwt-crypto    文件:IESEngine.java   
/**
 * set up for use with stream mode, where the key derivation function
 * is used to provide a stream of bytes to xor with the message.
 *
 * @param agree the key agreement used as the basis for the encryption
 * @param kdf   the key derivation function used for byte generation
 * @param mac   the message authentication code generator for the message
 */
public IESEngine(
    BasicAgreement agree,
    DerivationFunction kdf,
    Mac mac)
{
    this.agree = agree;
    this.kdf = kdf;
    this.mac = mac;
    this.macBuf = new byte[mac.getMacSize()];
    this.cipher = null;
}
项目:gwt-crypto    文件:IESEngine.java   
/**
 * set up for use in conjunction with a block cipher to handle the
 * message.
 *
 * @param agree  the key agreement used as the basis for the encryption
 * @param kdf    the key derivation function used for byte generation
 * @param mac    the message authentication code generator for the message
 * @param cipher the cipher to used for encrypting the message
 */
public IESEngine(
    BasicAgreement agree,
    DerivationFunction kdf,
    Mac mac,
    BufferedBlockCipher cipher)
{
    this.agree = agree;
    this.kdf = kdf;
    this.mac = mac;
    this.macBuf = new byte[mac.getMacSize()];
    this.cipher = cipher;
}
项目:gwt-crypto    文件:RSAKeyEncapsulation.java   
/**
 * Set up the RSA-KEM.
 *
 * @param kdf the key derivation function to be used.
 * @param rnd the random source for the session key.
 */
public RSAKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd)
{
    this.kdf = kdf;
    this.rnd = rnd;
}
项目:gwt-crypto    文件:ECIESKeyEncapsulation.java   
/**
 * Set up the ECIES-KEM.
 *
 * @param kdf the key derivation function to be used.
 * @param rnd the random source for the session key.
 */
public ECIESKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd)
{
    this.kdf = kdf;
    this.rnd = rnd;
    this.CofactorMode = false;
    this.OldCofactorMode = false;
    this.SingleHashMode = false;
}
项目:Aki-SSL    文件:IESEngine.java   
/**
 * set up for use with stream mode, where the key derivation function
 * is used to provide a stream of bytes to xor with the message.
 *
 * @param agree the key agreement used as the basis for the encryption
 * @param kdf   the key derivation function used for byte generation
 * @param mac   the message authentication code generator for the message
 */
public IESEngine(
    BasicAgreement agree,
    DerivationFunction kdf,
    Mac mac)
{
    this.agree = agree;
    this.kdf = kdf;
    this.mac = mac;
    this.macBuf = new byte[mac.getMacSize()];
    this.cipher = null;
}
项目:Aki-SSL    文件:IESEngine.java   
/**
 * set up for use in conjunction with a block cipher to handle the
 * message.
 *
 * @param agree  the key agreement used as the basis for the encryption
 * @param kdf    the key derivation function used for byte generation
 * @param mac    the message authentication code generator for the message
 * @param cipher the cipher to used for encrypting the message
 */
public IESEngine(
    BasicAgreement agree,
    DerivationFunction kdf,
    Mac mac,
    BufferedBlockCipher cipher)
{
    this.agree = agree;
    this.kdf = kdf;
    this.mac = mac;
    this.macBuf = new byte[mac.getMacSize()];
    this.cipher = cipher;
}
项目:Aki-SSL    文件:RSAKeyEncapsulation.java   
/**
 * Set up the RSA-KEM.
 *
 * @param kdf the key derivation function to be used.
 * @param rnd the random source for the session key.
 */
public RSAKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd)
{
    this.kdf = kdf;
    this.rnd = rnd;
}
项目:Aki-SSL    文件:ECIESKeyEncapsulation.java   
/**
 * Set up the ECIES-KEM.
 *
 * @param kdf the key derivation function to be used.
 * @param rnd the random source for the session key.
 */
public ECIESKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd)
{
    this.kdf = kdf;
    this.rnd = rnd;
    this.CofactorMode = false;
    this.OldCofactorMode = false;
    this.SingleHashMode = false;
}
项目:Aki-SSL    文件:KeyAgreementSpi.java   
protected KeyAgreementSpi(
    String kaAlgorithm,
    BasicAgreement agreement,
    DerivationFunction kdf)
{
    super(kaAlgorithm, kdf);

    this.kaAlgorithm = kaAlgorithm;
    this.agreement = agreement;
}
项目:TinyTravelTracker    文件:IESEngine.java   
/**
 * set up for use with stream mode, where the key derivation function
 * is used to provide a stream of bytes to xor with the message.
 *
 * @param agree the key agreement used as the basis for the encryption
 * @param kdf   the key derivation function used for byte generation
 * @param mac   the message authentication code generator for the message
 */
public IESEngine(
    BasicAgreement agree,
    DerivationFunction kdf,
    Mac mac)
{
    this.agree = agree;
    this.kdf = kdf;
    this.mac = mac;
    this.macBuf = new byte[mac.getMacSize()];
    this.cipher = null;
}
项目:TinyTravelTracker    文件:IESEngine.java   
/**
 * set up for use in conjunction with a block cipher to handle the
 * message.
 *
 * @param agree  the key agreement used as the basis for the encryption
 * @param kdf    the key derivation function used for byte generation
 * @param mac    the message authentication code generator for the message
 * @param cipher the cipher to used for encrypting the message
 */
public IESEngine(
    BasicAgreement agree,
    DerivationFunction kdf,
    Mac mac,
    BufferedBlockCipher cipher)
{
    this.agree = agree;
    this.kdf = kdf;
    this.mac = mac;
    this.macBuf = new byte[mac.getMacSize()];
    this.cipher = cipher;
}
项目:TinyTravelTracker    文件:RSAKeyEncapsulation.java   
/**
 * Set up the RSA-KEM.
 *
 * @param kdf the key derivation function to be used.
 * @param rnd the random source for the session key.
 */
public RSAKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd)
{
    this.kdf = kdf;
    this.rnd = rnd;
}
项目:TinyTravelTracker    文件:ECIESKeyEncapsulation.java   
/**
 * Set up the ECIES-KEM.
 *
 * @param kdf the key derivation function to be used.
 * @param rnd the random source for the session key.
 */
public ECIESKeyEncapsulation(
    DerivationFunction kdf,
    SecureRandom rnd)
{
    this.kdf = kdf;
    this.rnd = rnd;
    this.CofactorMode = false;
    this.OldCofactorMode = false;
    this.SingleHashMode = false;
}