/external/bouncycastle/bcprov/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/bcprov/src/main/java/org/bouncycastle/crypto/modes/ |
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. 15 private final BlockCipher cipher; field in class:SICBlockCipher 26 * @param c the block cipher to be used. 30 this.cipher = c; 31 this.blockSize = cipher.getBlockSize(); 39 * return the underlying block cipher that we are wrapping. 41 * @return the underlying block cipher that we are wrapping. 45 return cipher; 65 cipher.init(true, ivParam.getParameters()); 76 return cipher.getAlgorithmName() + "/SIC" [all...] |
CFBBlockCipher.java | 10 * implements a Cipher-FeedBack (CFB) mode on top of a simple cipher. 20 private BlockCipher cipher = null; field in class:CFBBlockCipher 26 * @param cipher the block cipher to be used as the basis of the 31 BlockCipher cipher, 34 this.cipher = cipher; 37 this.IV = new byte[cipher.getBlockSize()]; 38 this.cfbV = 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...] |
GCMBlockCipher.java | 27 private BlockCipher cipher; field in class:GCMBlockCipher 61 "cipher required with a block size of " + BLOCK_SIZE + "."); 70 this.cipher = c; 76 return cipher; 81 return cipher.getAlgorithmName() + "/GCM"; 134 // Cipher always used in forward mode 138 cipher.init(true, keyParam); 141 cipher.processBlock(H, 0, H, 0); 335 * Some AAD was sent after the cipher started. We determine the difference b/w the hash value 336 * we actually used when the cipher started (S_atPre) and the final hash value calculated (S_at) [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/bcprov/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...] |
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/util/ |
BaseStreamCipher.java | 11 import javax.crypto.Cipher; 48 private StreamCipher cipher; field in class:BaseStreamCipher 60 cipher = engine; 70 cipher = new StreamBlockCipher(engine); 185 param = PBE.Util.makePBEParameters(k, params, cipher.getAlgorithmName()); 221 if ((opmode == Cipher.ENCRYPT_MODE) || (opmode == Cipher.WRAP_MODE)) 239 case Cipher.ENCRYPT_MODE: 240 case Cipher.WRAP_MODE: 241 cipher.init(true, param) [all...] |
BaseBlockCipher.java | 15 import javax.crypto.Cipher; 102 private GenericBlockCipher cipher; field in class:BaseBlockCipher 134 cipher = new BufferedGenericBlockCipher(engine); 143 cipher = new BufferedGenericBlockCipher(provider.get()); 151 cipher = new AEADGenericBlockCipher(engine); 160 this.cipher = new BufferedGenericBlockCipher(engine); 170 this.cipher = new BufferedGenericBlockCipher(engine); 198 return cipher.getOutputSize(inputLen); 219 String name = cipher.getUnderlyingCipher().getAlgorithmName(); 262 cipher = new BufferedGenericBlockCipher(baseEngine) 944 private BufferedBlockCipher cipher; field in class:BaseBlockCipher.BufferedGenericBlockCipher 1016 private AEADBlockCipher cipher; field in class:BaseBlockCipher.AEADGenericBlockCipher [all...] |
/external/chromium_org/net/ssl/ |
ssl_cipher_suite_names_unittest.cc | 15 const char *key_exchange, *cipher, *mac; local 18 SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, 0xc001); 20 EXPECT_STREQ("NULL", cipher); 24 SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, 0x009f); 26 EXPECT_STREQ("AES_256_GCM", cipher); 30 SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, 0xff31); 32 EXPECT_STREQ("???", cipher); 60 // Picked some random cipher suites. 67 // Non-existent cipher suite.
|
/external/apache-harmony/crypto/src/test/impl/java/org/apache/harmony/crypto/tests/javax/crypto/ |
Cipher_Impl1Test.java | 25 import javax.crypto.Cipher; 46 * @tests javax.crypto.Cipher#getIV() 47 * @tests javax.crypto.Cipher#init(int, java.security.Key, 57 Cipher cipher = null; local 64 cipher = Cipher.getInstance(algorithm + "/CBC/PKCS5Padding"); 65 cipher.init(Cipher.ENCRYPT_MODE, cipherKey, ap); 67 byte[] cipherIV = cipher.getIV() 85 Cipher cipher = null; local [all...] |
/libcore/luni/src/main/java/javax/crypto/ |
CipherInputStream.java | 28 * This class wraps an {@code InputStream} and a cipher so that {@code read()} 30 * processed by the cipher. 32 * The cipher must be initialized for the requested operation before being used 33 * by a {@code CipherInputStream}. For example, if a cipher initialized for 38 private final Cipher cipher; field in class:CipherInputStream 47 * InputStream} and a cipher. 56 * the cipher to process the data with. 58 public CipherInputStream(InputStream is, Cipher c) { 60 this.cipher = c [all...] |
SealedObject.java | 37 * instance and encrypts it using a cryptographic cipher. 44 * object itself keeps track of the cipher and corresponding parameters. 51 * The cipher's {@link AlgorithmParameters} in encoded format. 52 * Equivalent to {@code cipher.getParameters().getEncoded()}, 53 * or null if the cipher did not use any parameters. 81 * and sealing it using the specified cipher. 83 * The cipher must be fully initialized. 88 * the cipher to encrypt the object. 92 * if the specified cipher is a block cipher and the length o 173 Cipher cipher = Cipher.getInstance(sealAlg); local 261 Cipher cipher = Cipher.getInstance(sealAlg, provider); local [all...] |
CipherOutputStream.java | 26 * This class wraps an output stream and a cipher so that {@code write} methods 27 * send the data through the cipher before writing them to the underlying output 30 * The cipher must be initialized for the requested operation before being used 31 * by a {@code CipherOutputStream}. For example, if a cipher initialized for 37 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/bouncycastle/bcprov/src/main/java/org/bouncycastle/jce/provider/ |
JCEStreamCipher.java | 18 import javax.crypto.Cipher; 72 private StreamCipher cipher; field in class:JCEStreamCipher 86 cipher = engine; 96 cipher = new StreamBlockCipher(engine); 211 param = PBE.Util.makePBEParameters(k, params, cipher.getAlgorithmName()); 247 if ((opmode == Cipher.ENCRYPT_MODE) || (opmode == Cipher.WRAP_MODE)) 263 case Cipher.ENCRYPT_MODE: 264 case Cipher.WRAP_MODE: 265 cipher.init(true, param) [all...] |
/external/chromium_org/crypto/ |
symmetric_key_nss.cc | 87 CK_MECHANISM_TYPE cipher = local 103 PK11SymKey* sym_key = PK11_ImportSymKey(slot.get(), cipher, PK11_OriginUnwrap,
|
/external/chromium_org/third_party/openssl/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;
|
/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;
|
/external/apache-harmony/crypto/src/test/api/java.injected/javax/crypto/ |
SealedObjectTest.java | 31 import javax.crypto.Cipher; 71 * SealedObject(Serializable object, Cipher c) method testing. Tests if the 72 * NullPointerException is thrown in the case of null cipher. 79 + "of null cipher."); 97 Cipher cipher = new NullCipher(); local 98 SealedObject so1 = new SealedObject(secret, cipher); 103 .getObject(cipher)); 111 * corresponding value of Cipher object. 119 Cipher cipher = Cipher.getInstance(algorithm) local 139 Cipher cipher = Cipher.getInstance("DES\/CBC\/PKCS5Padding"); local 174 Cipher cipher = Cipher.getInstance("DES\/CBC\/PKCS5Padding"); local 212 Cipher cipher = Cipher.getInstance("DES"); local [all...] |
/external/chromium_org/content/public/android/java/src/org/chromium/content/browser/crypto/ |
CipherFactory.java | 20 import javax.crypto.Cipher; 26 * Generates {@link Cipher} instances for encrypting session data that is temporarily stored. 39 * - Encrypt data with a {@link Cipher} from {@link CipherFactory#getCipher(int)} before storing it. 40 * - Store {@link Cipher} parameters in the Bundle via {@link CipherFactory#saveToBundle(Bundle)}. 70 * Synchronization primitive to prevent thrashing the cipher parameters between threads 75 /** Used to generate data needed for the Cipher on a background thread. */ 78 /** Holds data for cipher generation. */ 90 * Creates a secure Cipher for encrypting data. 91 * This function blocks until data needed to generate a Cipher has been created by the 93 * @param opmode One of Cipher.{ENCRYPT,DECRYPT}_MODE 101 Cipher cipher = Cipher.getInstance("AES\/CBC\/PKCS5Padding"); local [all...] |