/external/bouncycastle/src/main/java/org/bouncycastle/crypto/ |
StreamBlockCipher.java | 10 private BlockCipher cipher; field in class:StreamBlockCipher 17 * @param cipher the block cipher to be wrapped. 18 * @exception IllegalArgumentException if the cipher has a block size other than 22 BlockCipher cipher) 24 if (cipher.getBlockSize() != 1) 26 throw new IllegalArgumentException("block cipher block size != 1."); 29 this.cipher = cipher; 33 * initialise the underlying cipher [all...] |
BufferedBlockCipher.java | 9 * Note: in the case where the underlying cipher is either a CFB cipher or an 18 protected BlockCipher cipher; field in class:BufferedBlockCipher 31 * Create a buffered block cipher without padding. 33 * @param cipher the underlying block cipher this buffering object wraps. 36 BlockCipher cipher) 38 this.cipher = cipher; 40 buf = new byte[cipher.getBlockSize()] [all...] |
/external/bouncycastle/src/main/java/org/bouncycastle/crypto/modes/ |
CFBBlockCipher.java | 9 * implements a Cipher-FeedBack (CFB) mode on top of a simple cipher. 19 private BlockCipher cipher = null; field in class:CFBBlockCipher 25 * @param cipher the block cipher to be used as the basis of the 30 BlockCipher cipher, 33 this.cipher = cipher; 36 this.IV = new byte[cipher.getBlockSize()]; 37 this.cfbV = new byte[cipher.getBlockSize()] [all...] |
OFBBlockCipher.java | 9 * implements a Output-FeedBack (OFB) mode on top of a simple cipher. 19 private final BlockCipher cipher; field in class:OFBBlockCipher 24 * @param cipher the block cipher to be used as the basis of the 29 BlockCipher cipher, 32 this.cipher = cipher; 35 this.IV = new byte[cipher.getBlockSize()]; 36 this.ofbV = new byte[cipher.getBlockSize()]; 37 this.ofbOutV = new byte[cipher.getBlockSize()] [all...] |
SICBlockCipher.java | 10 * block cipher. This mode is also known as CTR mode. 14 private final BlockCipher cipher; field in class:SICBlockCipher 25 * @param c the block cipher to be used. 29 this.cipher = c; 30 this.blockSize = cipher.getBlockSize(); 38 * return the underlying block cipher that we are wrapping. 40 * @return the underlying block cipher that we are wrapping. 44 return cipher; 60 cipher.init(true, ivParam.getParameters()); 70 return cipher.getAlgorithmName() + "/SIC" [all...] |
GOFBBlockCipher.java | 19 private final BlockCipher cipher; field in class:GOFBBlockCipher 31 * @param cipher the block cipher to be used as the basis of the 35 BlockCipher cipher) 37 this.cipher = cipher; 38 this.blockSize = cipher.getBlockSize(); 45 this.IV = new byte[cipher.getBlockSize()]; 46 this.ofbV = new byte[cipher.getBlockSize()]; 47 this.ofbOutV = new byte[cipher.getBlockSize()] [all...] |
CBCBlockCipher.java | 10 * implements Cipher-Block-Chaining (CBC) mode on top of a simple cipher. 20 private BlockCipher cipher = null; field in class:CBCBlockCipher 26 * @param cipher the block cipher to be used as the basis of chaining. 29 BlockCipher cipher) 31 this.cipher = cipher; 32 this.blockSize = cipher.getBlockSize(); 40 * return the underlying block cipher that we are wrapping [all...] |
EAXBlockCipher.java | 20 * cipher to encrypt and authenticate data. It's on-line (the length of a 22 * simple and provably secure (provided the underlying block cipher is secure). 35 private SICBlockCipher cipher; field in class:EAXBlockCipher 52 * Constructor that accepts an instance of a block cipher engine. 54 * @param cipher the engine to use 56 public EAXBlockCipher(BlockCipher cipher) 58 blockSize = cipher.getBlockSize(); 59 mac = new CMac(cipher); 64 this.cipher = new SICBlockCipher(cipher); [all...] |
GCMBlockCipher.java | 26 private BlockCipher cipher; field in class:GCMBlockCipher 57 "cipher required with a block size of " + BLOCK_SIZE + "."); 66 this.cipher = c; 72 return cipher; 77 return cipher.getAlgorithmName() + "/GCM"; 130 // Cipher always used in forward mode 131 cipher.init(true, keyParam); 138 cipher.processBlock(ZEROES, 0, H, 0); 269 cipher.processBlock(J0, 0, tag, 0); 323 cipher.reset() [all...] |
CTSBlockCipher.java | 9 * A Cipher Text Stealing (CTS) mode cipher. CTS allows block ciphers to 10 * be used to produce cipher text which is the same length as the plain text. 18 * Create a buffered block cipher that uses Cipher Text Stealing 20 * @param cipher the underlying block cipher this buffering object wraps. 23 BlockCipher cipher) 25 if ((cipher instanceof OFBBlockCipher) || (cipher instanceof CFBBlockCipher) [all...] |
/libcore/support/src/test/java/tests/security/ |
CipherHelper.java | 23 import javax.crypto.Cipher; 43 Cipher cipher = null; local 45 cipher = Cipher.getInstance(algorithmName); 52 cipher.init(mode1, encryptKey); 57 byte[] encrypted = crypt(cipher, plainData.getBytes()); 60 cipher.init(mode2, decryptKey); 65 byte[] decrypted = crypt(cipher, encrypted); 73 public byte[] crypt(Cipher cipher, byte[] input) [all...] |
AlgorithmParameterAsymmetricHelper.java | 27 import javax.crypto.Cipher; 56 Cipher cipher = null; local 58 cipher = Cipher.getInstance(algorithmName); 66 cipher.init(Cipher.ENCRYPT_MODE, keyPair.getPublic(), parameters); 75 bs = cipher.doFinal(plainData.getBytes()); 83 cipher.init(Cipher.DECRYPT_MODE, keyPair.getPrivate(), parameters) [all...] |
AlgorithmParameterSymmetricHelper.java | 26 import javax.crypto.Cipher; 64 Cipher cipher = null; local 71 cipher = Cipher.getInstance(transformation); 79 cipher.init(Cipher.ENCRYPT_MODE, key, parameters); 88 bs = cipher.doFinal(plainData.getBytes()); 96 cipher.init(Cipher.DECRYPT_MODE, key, parameters) [all...] |
/external/bouncycastle/src/main/java/org/bouncycastle/crypto/macs/ |
CBCBlockCipherMac.java | 10 * standard CBC Block Cipher MAC - if no padding is specified the default of 20 private BlockCipher cipher; field in class:CBCBlockCipherMac 26 * create a standard MAC based on a CBC block cipher. This will produce an 27 * authentication code half the length of the block size of the cipher. 29 * @param cipher the cipher to be used as the basis of the MAC generation. 32 BlockCipher cipher) 34 this(cipher, (cipher.getBlockSize() * 8) / 2, null); 38 * create a standard MAC based on a CBC block cipher. This will produce a [all...] |
CMac.java | 20 * CMAC/OMAC1 is a simple variant of the CBC MAC (Cipher Block Chaining Message 25 * cipher. 39 private BlockCipher cipher; field in class:CMac 46 * create a standard MAC based on a CBC block cipher (64 or 128 bit block). 48 * of the cipher. 50 * @param cipher the cipher to be used as the basis of the MAC generation. 52 public CMac(BlockCipher cipher) 54 this(cipher, cipher.getBlockSize() * 8) [all...] |
/external/bouncycastle/src/main/java/org/bouncycastle/jce/provider/ |
JCEStreamCipher.java | 28 import javax.crypto.Cipher; 61 private StreamCipher cipher; field in class:JCEStreamCipher 73 cipher = engine; 83 cipher = new StreamBlockCipher(engine); 198 param = PBE.Util.makePBEParameters(k, params, cipher.getAlgorithmName()); 234 if ((opmode == Cipher.ENCRYPT_MODE) || (opmode == Cipher.WRAP_MODE)) 250 case Cipher.ENCRYPT_MODE: 251 case Cipher.WRAP_MODE: 252 cipher.init(true, param) [all...] |
JDKDigestSignature.java | 51 private AsymmetricBlockCipher cipher; field in class:JDKDigestSignature 57 AsymmetricBlockCipher cipher) 60 this.cipher = cipher; 68 AsymmetricBlockCipher cipher) 71 this.cipher = cipher; 87 cipher.init(false, param); 103 cipher.init(true, param); 144 return cipher.processBlock(bytes, 0, bytes.length) [all...] |
JCEBlockCipher.java | 68 import javax.crypto.Cipher; 108 private GenericBlockCipher cipher; field in class:JCEBlockCipher 125 cipher = new BufferedGenericBlockCipher(engine); 134 this.cipher = new BufferedGenericBlockCipher(engine); 144 this.cipher = new BufferedGenericBlockCipher(engine); 167 return cipher.getOutputSize(inputLen); 188 String name = cipher.getUnderlyingCipher().getAlgorithmName(); 219 cipher = new BufferedGenericBlockCipher(baseEngine); 224 cipher = new BufferedGenericBlockCipher( 234 cipher = new BufferedGenericBlockCipher 1257 private BufferedBlockCipher cipher; field in class:JCEBlockCipher.BufferedGenericBlockCipher 1324 private AEADBlockCipher cipher; field in class:JCEBlockCipher.AEADGenericBlockCipher [all...] |
/libcore/luni/src/main/java/javax/crypto/ |
CipherInputStream.java | 26 * This class wraps an {@code InputStream} and a cipher so that {@code read()} 28 * processed by the cipher. 30 * The cipher must be initialized for the requested operation before being used 31 * by a {@code CipherInputStream}. For example, if a cipher initialized for 37 private final Cipher cipher; field in class:CipherInputStream 46 * InputStream} and a cipher. 55 * the cipher to process the data with. 57 public CipherInputStream(InputStream is, Cipher c) { 59 this.cipher = c [all...] |
SealedObject.java | 35 * instance and encrypts it using a cryptographic cipher. 42 * object itself keeps track of the cipher and corresponding parameters. 66 * and sealing it using the specified cipher. 68 * The cipher must be fully initialized. 73 * the cipher to encrypt the object. 77 * if the specified cipher is a block cipher and the length of 81 * if the cipher is {@code null}. 83 public SealedObject(Serializable object, Cipher c) 99 // should be never thrown because the cipher 155 Cipher cipher = Cipher.getInstance(sealAlg); local 250 Cipher cipher = Cipher.getInstance(sealAlg, provider); local [all...] |
CipherOutputStream.java | 25 * This class wraps an output stream and a cipher so that {@code write} methods 26 * send the data through the cipher before writing them to the underlying output 29 * The cipher must be initialized for the requested operation before being used 30 * by a {@code CipherOutputStream}. For example, if a cipher initialized for 36 private final Cipher cipher; field in class:CipherOutputStream 41 * OutputStream} and a {@code Cipher}. 46 * the cipher to process the data with. 48 public CipherOutputStream(OutputStream os, Cipher c) { 50 cipher = c [all...] |
EncryptedPrivateKeyInfo.java | 227 * The cipher must be initialize in either {@code Cipher.DECRYPT_MODE} or 228 * {@code Cipher.UNWRAP_MODE} with the same parameters and key used for 231 * @param cipher 232 * the cipher initialized for decrypting the encrypted data. 235 * if the specified cipher is not suited to decrypt the 238 * if {@code cipher} is {@code null}. 240 public PKCS8EncodedKeySpec getKeySpec(Cipher cipher) 242 if (cipher == null) 284 Cipher cipher = Cipher.getInstance(algName); local 343 Cipher cipher = Cipher.getInstance(algName, providerName); local 397 Cipher cipher = Cipher.getInstance(algName, provider); local [all...] |
/external/openssl/crypto/pkcs7/ |
enc.c | 77 const EVP_CIPHER *cipher=NULL; local 91 if(!(cipher = EVP_get_cipherbyname(argv[2]))) { 92 fprintf(stderr, "Unknown cipher %s\n", argv[2]); 130 if(!cipher) { 132 cipher = EVP_des_ede3_cbc(); 134 fprintf(stderr, "No cipher selected\n"); 139 if (!PKCS7_set_cipher(p7,cipher)) goto err;
|
/libcore/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ |
DigitalSignature.java | 29 import javax.crypto.Cipher; 61 private final Cipher cipher; field in class:DigitalSignature 76 cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); 81 cipher = null; 84 cipher = null; 105 } else if (cipher != null) { 106 cipher.init(Cipher.ENCRYPT_MODE, key) [all...] |
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ |
SealedObjectTest.java | 42 import javax.crypto.Cipher; 55 public Mock_SealedObject(Serializable object, Cipher c) 99 * SealedObject(Serializable object, Cipher c) method testing. Tests if the 100 * NullPointerException is thrown in the case of null cipher. 105 args = {java.io.Serializable.class, javax.crypto.Cipher.class} 112 + "of null cipher."); 122 Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); local 123 cipher.init(Cipher.ENCRYPT_MODE, key, ips) 157 Cipher cipher = new NullCipher(); local 185 Cipher cipher = Cipher.getInstance(algorithm); local 211 Cipher cipher = Cipher.getInstance("DES\/CBC\/PKCS5Padding"); local 261 Cipher cipher = Cipher.getInstance("DES\/CBC\/PKCS5Padding"); local 311 Cipher cipher = Cipher.getInstance("DES"); local [all...] |