Examples of processBlock()


Examples of org.bouncycastle.crypto.BlockCipher.processBlock()

            return new SimpleTestResult(false, getName() + ": test 1 - in != out");
        }

        ofb.init(true, new ParametersWithIV(key, Hex.decode("11223344")));

        ofb.processBlock(input, 0, out1, 0);

        ofb.init(false, new ParametersWithIV(key, Hex.decode("0000000011223344")));
        ofb.processBlock(out1, 0, out2, 0);

        if (!isEqualTo(out2, input))
View Full Code Here

Examples of org.bouncycastle.crypto.BlockCipher.processBlock()

        ofb.init(true, new ParametersWithIV(key, Hex.decode("11223344")));

        ofb.processBlock(input, 0, out1, 0);

        ofb.init(false, new ParametersWithIV(key, Hex.decode("0000000011223344")));
        ofb.processBlock(out1, 0, out2, 0);

        if (!isEqualTo(out2, input))
        {
            return new SimpleTestResult(false, getName() + ": test 2 - in != out");
        }
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.ISO9796d1Encoding.processBlock()

        eng.setPadBits(4);

        try
        {
            data = eng.processBlock(msg1, 0, msg1.length);
        }
        catch (Exception e)
        {
            return new SimpleTestResult(false, "ISO9796: failed - exception " + e.toString());
        }
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.OAEPEncoding.processBlock()

            byte[]  input = new byte[]
                { (byte)0x54, (byte)0x85, (byte)0x9b, (byte)0x34, (byte)0x2c, (byte)0x49, (byte)0xea, (byte)0x2a };
   
            try
            {
                out = cipher.processBlock(input, 0, input.length);
            }
            catch (Exception e)
            {
                return new SimpleTestResult(false, getName() + ": exception - " + e.toString());
            }
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding.processBlock()

             
              param = new ParametersWithRandom(param, RandomUtils.SECURE_RANDOM);
             
              padded_eng.init( true, param );
       
        encryped_session_key = padded_eng.processBlock(secret_bytes, 0, secret_bytes.length);
      }

    }catch( Throwable e ){
     
      e.printStackTrace();
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding.processBlock()

        PKCS1Encoding encoding = new PKCS1Encoding(new RSABlindedEngine());
        encoding.init(true, new ParametersWithRandom(rsaServerPublicKey, context.getSecureRandom()));

        try
        {
            byte[] encryptedPreMasterSecret = encoding.processBlock(premasterSecret, 0, premasterSecret.length);

            if (context.getServerVersion().isSSL())
            {
                // TODO Do any SSLv3 servers actually expect the length?
                output.write(encryptedPreMasterSecret);
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding.processBlock()

        PKCS1Encoding encoding = new PKCS1Encoding(new RSABlindedEngine());
        encoding.init(false, new ParametersWithRandom(this.privateKey, context.getSecureRandom()));

        try
        {
            return encoding.processBlock(encryptedPreMasterSecret, 0,
                encryptedPreMasterSecret.length);
        }
        catch (InvalidCipherTextException e)
        {
            throw new TlsFatalAlert(AlertDescription.illegal_parameter);
View Full Code Here

Examples of org.bouncycastle.crypto.encodings.PKCS1Encoding.processBlock()

  private String generate() throws Exception{
    RSAKeyParameters pubParameters = new RSAKeyParameters(false, mod, exp);
    AsymmetricBlockCipher eng = new PKCS1Encoding(new RSAEngine());
    eng.init(true, pubParameters);
    byte[] data = Base16.fromHexString(this.sessionKey);
    data = eng.processBlock(data, 0, data.length);
    return Base16.toHexString(data);
  }

  public void generateSessionKey() throws Exception{
    byte[] sessionBytes = new byte[SimmetricProvider.cipherKeySize];
View Full Code Here

Examples of org.bouncycastle.crypto.engines.DESEngine.processBlock()

        // Added to code from base class
        DESEngine deseng = new DESEngine();
       
        deseng.init(false, this.lastKey2);
        deseng.processBlock(mac, 0, mac, 0);
       
        deseng.init(true, this.lastKey3);
        deseng.processBlock(mac, 0, mac, 0);
        // ****
       
View Full Code Here

Examples of org.bouncycastle.crypto.engines.DESEngine.processBlock()

       
        deseng.init(false, this.lastKey2);
        deseng.processBlock(mac, 0, mac, 0);
       
        deseng.init(true, this.lastKey3);
        deseng.processBlock(mac, 0, mac, 0);
        // ****
       
        System.arraycopy(mac, 0, out, outOff, macSize);
       
        reset();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.