Home
last modified time | relevance | path

Searched refs:cipher (Results 1 – 25 of 345) sorted by relevance

12345678910>>...14

/external/bouncycastle/src/main/java/org/bouncycastle/jce/provider/
DJCEBlockCipher.java92 private GenericBlockCipher cipher; field in JCEBlockCipher
109 cipher = new BufferedGenericBlockCipher(engine); in JCEBlockCipher()
118 this.cipher = new BufferedGenericBlockCipher(engine); in JCEBlockCipher()
128 this.cipher = new BufferedGenericBlockCipher(engine); in JCEBlockCipher()
151 return cipher.getOutputSize(inputLen); in engineGetOutputSize()
172 String name = cipher.getUnderlyingCipher().getAlgorithmName(); in engineGetParameters()
203 cipher = new BufferedGenericBlockCipher(baseEngine); in engineSetMode()
208 cipher = new BufferedGenericBlockCipher( in engineSetMode()
218 cipher = new BufferedGenericBlockCipher( in engineSetMode()
223 cipher = new BufferedGenericBlockCipher( in engineSetMode()
[all …]
DJCERSACipher.java38 private AsymmetricBlockCipher cipher; field in JCERSACipher
48 cipher = engine; in JCERSACipher()
71 cipher = engine; in JCERSACipher()
86cipher = new OAEPEncoding(new RSABlindedEngine(), digest, ((PSource.PSpecified)pSpec.getPSource())… in initFromSpec()
94 return cipher.getInputBlockSize(); in engineGetBlockSize()
131 return cipher.getOutputBlockSize(); in engineGetOutputSize()
195 cipher = new RSABlindedEngine(); in engineSetPadding()
199 cipher = new PKCS1Encoding(new RSABlindedEngine()); in engineSetPadding()
203 cipher = new ISO9796d1Encoding(new RSABlindedEngine()); in engineSetPadding()
306cipher = new OAEPEncoding(new RSABlindedEngine(), digest, mgfDigest, ((PSource.PSpecified)spec.get… in engineInit()
[all …]
/external/bouncycastle/src/main/java/org/bouncycastle/crypto/macs/
DCBCBlockCipherMac.java20 private BlockCipher cipher; field in CBCBlockCipherMac
32 BlockCipher cipher) in CBCBlockCipherMac() argument
34 this(cipher, (cipher.getBlockSize() * 8) / 2, null); in CBCBlockCipherMac()
45 BlockCipher cipher, in CBCBlockCipherMac() argument
48 this(cipher, (cipher.getBlockSize() * 8) / 2, padding); in CBCBlockCipherMac()
65 BlockCipher cipher, in CBCBlockCipherMac() argument
68 this(cipher, macSizeInBits, null); in CBCBlockCipherMac()
86 BlockCipher cipher, in CBCBlockCipherMac() argument
95 this.cipher = new CBCBlockCipher(cipher); in CBCBlockCipherMac()
99 mac = new byte[cipher.getBlockSize()]; in CBCBlockCipherMac()
[all …]
/external/openssl/crypto/evp/
Devp_enc.c75 #define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl)
95 int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, in EVP_CipherInit() argument
98 if (cipher) in EVP_CipherInit()
100 return EVP_CipherInit_ex(ctx,cipher,NULL,key,iv,enc); in EVP_CipherInit()
103 int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, in EVP_CipherInit_ex() argument
119 if (ctx->engine && ctx->cipher && (!cipher || in EVP_CipherInit_ex()
120 (cipher && (cipher->nid == ctx->cipher->nid)))) in EVP_CipherInit_ex()
123 if (cipher) in EVP_CipherInit_ex()
128 if (ctx->cipher) in EVP_CipherInit_ex()
147 impl = ENGINE_get_cipher_engine(cipher->nid); in EVP_CipherInit_ex()
[all …]
Devp_lib.c68 if (c->cipher->set_asn1_parameters != NULL) in EVP_CIPHER_param_to_asn1()
69 ret=c->cipher->set_asn1_parameters(c,type); in EVP_CIPHER_param_to_asn1()
70 else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) in EVP_CIPHER_param_to_asn1()
81 if (c->cipher->get_asn1_parameters != NULL) in EVP_CIPHER_asn1_to_param()
82 ret=c->cipher->get_asn1_parameters(c,type); in EVP_CIPHER_asn1_to_param()
83 else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) in EVP_CIPHER_asn1_to_param()
188 return ctx->cipher->block_size; in EVP_CIPHER_CTX_block_size()
193 return ctx->cipher->do_cipher(ctx,out,in,inl); in EVP_Cipher()
198 return ctx->cipher; in EVP_CIPHER_CTX_cipher()
201 unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher) in EVP_CIPHER_flags() argument
[all …]
Devp_test.c244 static int test_cipher(const char *cipher,const unsigned char *key,int kn, in test_cipher() argument
252 c=EVP_get_cipherbyname(cipher); in test_cipher()
368 char *cipher; in main() local
378 cipher=sstrsep(&p,":"); in main()
396 if(!test_cipher(cipher,key,kn,iv,in,plaintext,pn,ciphertext,cn,encdec) in main()
397 && !test_digest(cipher,plaintext,pn,ciphertext,cn)) in main()
400 if (strstr(cipher, "AES") == cipher) in main()
402 fprintf(stdout, "Cipher disabled, skipping %s\n", cipher); in main()
407 if (strstr(cipher, "DES") == cipher) in main()
409 fprintf(stdout, "Cipher disabled, skipping %s\n", cipher); in main()
[all …]
/external/dropbear/libtomcrypt/src/mac/xcbc/
Dxcbc_init.c27 int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned long keylen) in xcbc_init() argument
36 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in xcbc_init()
41 if (cipher_descriptor[cipher].block_length % sizeof(LTC_FAST_TYPE)) { in xcbc_init()
52 if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, skey)) != CRYPT_OK) { in xcbc_init()
58 for (x = 0; x < cipher_descriptor[cipher].block_length; x++) { in xcbc_init()
61 cipher_descriptor[cipher].ecb_encrypt(xcbc->K[y], xcbc->K[y], skey); in xcbc_init()
65 …err = cipher_descriptor[cipher].setup(xcbc->K[0], cipher_descriptor[cipher].block_length, 0, &xcbc… in xcbc_init()
68 zeromem(xcbc->IV, cipher_descriptor[cipher].block_length); in xcbc_init()
69 xcbc->blocksize = cipher_descriptor[cipher].block_length; in xcbc_init()
70 xcbc->cipher = cipher; in xcbc_init()
[all …]
/external/dropbear/libtomcrypt/src/headers/
Dtomcrypt_mac.h38 int omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned long keylen);
41 int omac_memory(int cipher,
45 int omac_memory_multi(int cipher,
49 int omac_file(int cipher,
72 int pmac_init(pmac_state *pmac, int cipher, const unsigned char *key, unsigned long keylen);
76 int pmac_memory(int cipher,
81 int pmac_memory_multi(int cipher,
86 int pmac_file(int cipher,
111 int eax_init(eax_state *eax, int cipher, const unsigned char *key, unsigned long keylen,
120 int eax_encrypt_authenticate_memory(int cipher,
[all …]
/external/apache-harmony/crypto/src/test/api/java.injected/javax/crypto/
DSealedObjectTest.java97 Cipher cipher = new NullCipher(); in testSealedObject2() local
98 SealedObject so1 = new SealedObject(secret, cipher); in testSealedObject2()
103 .getObject(cipher)); in testSealedObject2()
119 Cipher cipher = Cipher.getInstance(algorithm); in testGetAlgorithm() local
120 cipher.init(Cipher.ENCRYPT_MODE, key); in testGetAlgorithm()
121 SealedObject so = new SealedObject(secret, cipher); in testGetAlgorithm()
139 Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); in testGetObject1() local
140 cipher.init(Cipher.ENCRYPT_MODE, key, ips); in testGetObject1()
143 SealedObject so = new SealedObject(secret, cipher); in testGetObject1()
150 .equals(so.encodedParams, cipher.getParameters().getEncoded())); in testGetObject1()
[all …]
/external/srtp/doc/
Dcrypto_kernel.txt14 @brief A generic cipher type enables cipher agility, that is, the
15 ability to write code that runs with multiple cipher types.
24 * @brief Allocates a cipher of a particular type.
28 cipher_type_alloc(cipher_type_t *ctype, cipher_t **cipher,
32 * @brief Initialized a cipher to use a particular key. May
33 * be invoked more than once on the same cipher.
38 cipher_init(cipher_t *cipher, const uint8_t *key);
41 * @brief Sets the initialization vector of a given cipher.
46 cipher_set_iv(cipher_t *cipher, void *iv);
49 * @brief Encrypts a buffer with a given cipher.
[all …]
/external/bouncycastle/src/main/java/org/bouncycastle/crypto/modes/
DCTSBlockCipher.java23 BlockCipher cipher) in CTSBlockCipher() argument
25 if ((cipher instanceof OFBBlockCipher) || (cipher instanceof CFBBlockCipher)) in CTSBlockCipher()
30 this.cipher = cipher; in CTSBlockCipher()
32 blockSize = cipher.getBlockSize(); in CTSBlockCipher()
94 resultLen = cipher.processBlock(buf, 0, out, outOff); in processByte()
148 resultLen += cipher.processBlock(buf, 0, out, outOff); in processBytes()
159 resultLen += cipher.processBlock(buf, 0, out, outOff + resultLen); in processBytes()
197 int blockSize = cipher.getBlockSize(); in doFinal()
203 cipher.processBlock(buf, 0, block, 0); in doFinal()
220 if (cipher instanceof CBCBlockCipher) in doFinal()
[all …]
DOFBBlockCipher.java19 private final BlockCipher cipher; field in OFBBlockCipher
29 BlockCipher cipher, in OFBBlockCipher() argument
32 this.cipher = cipher; in OFBBlockCipher()
35 this.IV = new byte[cipher.getBlockSize()]; in OFBBlockCipher()
36 this.ofbV = new byte[cipher.getBlockSize()]; in OFBBlockCipher()
37 this.ofbOutV = new byte[cipher.getBlockSize()]; in OFBBlockCipher()
47 return cipher; in getUnderlyingCipher()
87 cipher.init(true, ivParam.getParameters()); in init()
93 cipher.init(true, params); in init()
105 return cipher.getAlgorithmName() + "/OFB" + (blockSize * 8); in getAlgorithmName()
[all …]
DGOFBBlockCipher.java19 private final BlockCipher cipher; field in GOFBBlockCipher
35 BlockCipher cipher) in GOFBBlockCipher() argument
37 this.cipher = cipher; in GOFBBlockCipher()
38 this.blockSize = cipher.getBlockSize(); in GOFBBlockCipher()
45 this.IV = new byte[cipher.getBlockSize()]; in GOFBBlockCipher()
46 this.ofbV = new byte[cipher.getBlockSize()]; in GOFBBlockCipher()
47 this.ofbOutV = new byte[cipher.getBlockSize()]; in GOFBBlockCipher()
57 return cipher; in getUnderlyingCipher()
101 cipher.init(true, ivParam.getParameters()); in init()
107 cipher.init(true, params); in init()
[all …]
DCFBBlockCipher.java19 private BlockCipher cipher = null; field in CFBBlockCipher
30 BlockCipher cipher, in CFBBlockCipher() argument
33 this.cipher = cipher; in CFBBlockCipher()
36 this.IV = new byte[cipher.getBlockSize()]; in CFBBlockCipher()
37 this.cfbV = new byte[cipher.getBlockSize()]; in CFBBlockCipher()
38 this.cfbOutV = new byte[cipher.getBlockSize()]; in CFBBlockCipher()
48 return cipher; in getUnderlyingCipher()
90 cipher.init(true, ivParam.getParameters()); in init()
96 cipher.init(true, params); in init()
108 return cipher.getAlgorithmName() + "/CFB" + (blockSize * 8); in getAlgorithmName()
[all …]
DCBCBlockCipher.java20 private BlockCipher cipher = null; field in CBCBlockCipher
29 BlockCipher cipher) in CBCBlockCipher() argument
31 this.cipher = cipher; in CBCBlockCipher()
32 this.blockSize = cipher.getBlockSize(); in CBCBlockCipher()
46 return cipher; in getUnderlyingCipher()
80 cipher.init(encrypting, ivParam.getParameters()); in init()
86 cipher.init(encrypting, params); in init()
97 return cipher.getAlgorithmName() + "/CBC"; in getAlgorithmName()
107 return cipher.getBlockSize(); in getBlockSize()
142 cipher.reset(); in reset()
[all …]
/external/bouncycastle/src/main/java/org/bouncycastle/crypto/
DBufferedBlockCipher.java18 protected BlockCipher cipher; field in BufferedBlockCipher
36 BlockCipher cipher) in BufferedBlockCipher() argument
38 this.cipher = cipher; in BufferedBlockCipher()
40 buf = new byte[cipher.getBlockSize()]; in BufferedBlockCipher()
46 String name = cipher.getAlgorithmName(); in BufferedBlockCipher()
68 return cipher; in getUnderlyingCipher()
89 cipher.init(forEncryption, params); in init()
99 return cipher.getBlockSize(); in getBlockSize()
118 leftOver = total % buf.length - (cipher.getBlockSize() + 2); in getUpdateOutputSize()
165 resultLen = cipher.processBlock(buf, 0, out, outOff); in processByte()
[all …]
DStreamBlockCipher.java10 private BlockCipher cipher; field in StreamBlockCipher
22 BlockCipher cipher) in StreamBlockCipher() argument
24 if (cipher.getBlockSize() != 1) in StreamBlockCipher()
29 this.cipher = cipher; in StreamBlockCipher()
42 cipher.init(forEncryption, params); in init()
52 return cipher.getAlgorithmName(); in getAlgorithmName()
66 cipher.processBlock(oneByte, 0, oneByte, 0); in returnByte()
96 cipher.processBlock(in, inOff + i, out, outOff + i); in processBytes()
106 cipher.reset(); in reset()
/external/ipsec-tools/src/racoon/missing/crypto/rijndael/
Drijndael-api-fst.c79 int rijndael_cipherInit(cipherInstance *cipher, BYTE mode, char *IV) { in rijndael_cipherInit() argument
81 cipher->mode = mode; in rijndael_cipherInit()
86 bcopy(IV, cipher->IV, MAX_IV_SIZE); in rijndael_cipherInit()
88 bzero(cipher->IV, MAX_IV_SIZE); in rijndael_cipherInit()
93 int rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key, in rijndael_blockEncrypt() argument
98 if (cipher == NULL || in rijndael_blockEncrypt()
109 switch (cipher->mode) { in rijndael_blockEncrypt()
120 bcopy(cipher->IV, block, 16); in rijndael_blockEncrypt()
127 ((word32*)block)[0] = ((word32*)cipher->IV)[0] ^ ((word32*)input)[0]; in rijndael_blockEncrypt()
128 ((word32*)block)[1] = ((word32*)cipher->IV)[1] ^ ((word32*)input)[1]; in rijndael_blockEncrypt()
[all …]
/external/apache-harmony/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/
DCipherTest.java65 Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding"); in test_getInstanceLjava_lang_String() local
66 assertNotNull("Received a null Cipher instance", cipher); in test_getInstanceLjava_lang_String()
81 Cipher cipher = Cipher.getInstance("DES", providers[i].getName()); in test_getInstanceLjava_lang_StringLjava_lang_String() local
82 assertNotNull("Cipher.getInstance() returned a null value", cipher); in test_getInstanceLjava_lang_StringLjava_lang_String()
86 cipher = Cipher.getInstance("DoBeDoBeDo", providers[i]); in test_getInstanceLjava_lang_StringLjava_lang_String()
122 Cipher cipher = Cipher.getInstance("DES", providers[i]); in test_getInstanceLjava_lang_StringLjava_security_Provider() local
123 assertNotNull("Cipher.getInstance() returned a null value", cipher); in test_getInstanceLjava_lang_StringLjava_security_Provider()
138 Cipher cipher = Cipher.getInstance("AES", provider.getName()); in test_getProvider() local
139 Provider cipherProvider = cipher.getProvider(); in test_getProvider()
152 Cipher cipher = Cipher.getInstance(algorithm); in test_getAlgorithm() local
[all …]
/external/openssh/
Dcipher.c206 cipher_init(CipherContext *cc, Cipher *cipher, in cipher_init() argument
219 if (cipher->number == SSH_CIPHER_DES) { in cipher_init()
228 cc->plaintext = (cipher->number == SSH_CIPHER_NONE); in cipher_init()
230 if (keylen < cipher->key_len) in cipher_init()
232 keylen, cipher->name); in cipher_init()
233 if (iv != NULL && ivlen < cipher->block_size) in cipher_init()
235 ivlen, cipher->name); in cipher_init()
236 cc->cipher = cipher; in cipher_init()
238 type = (*cipher->evptype)(); in cipher_init()
253 cipher->name); in cipher_init()
[all …]
/external/dropbear/libtomcrypt/src/modes/f8/
Df8_start.c33 int f8_start( int cipher, const unsigned char *IV, in f8_start() argument
46 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in f8_start()
51 if (cipher_descriptor[cipher].block_length % sizeof(LTC_FAST_TYPE)) { in f8_start()
58 f8->cipher = cipher; in f8_start()
59 f8->blocklen = cipher_descriptor[cipher].block_length; in f8_start()
75 if ((err = cipher_descriptor[cipher].setup(tkey, keylen, num_rounds, &f8->key)) != CRYPT_OK) { in f8_start()
80 if ((err = cipher_descriptor[f8->cipher].ecb_encrypt(IV, f8->MIV, &f8->key)) != CRYPT_OK) { in f8_start()
81 cipher_descriptor[f8->cipher].done(&f8->key); in f8_start()
88 cipher_descriptor[f8->cipher].done(&f8->key); in f8_start()
91 return cipher_descriptor[cipher].setup(key, keylen, num_rounds, &f8->key); in f8_start()
/external/bouncycastle/src/main/java/org/bouncycastle/crypto/paddings/
DPaddedBufferedBlockCipher.java29 BlockCipher cipher, in PaddedBufferedBlockCipher() argument
32 this.cipher = cipher; in PaddedBufferedBlockCipher()
35 buf = new byte[cipher.getBlockSize()]; in PaddedBufferedBlockCipher()
45 BlockCipher cipher) in PaddedBufferedBlockCipher() argument
47 this(cipher, new PKCS7Padding()); in PaddedBufferedBlockCipher()
74 cipher.init(forEncryption, p.getParameters()); in init()
80 cipher.init(forEncryption, params); in init()
153 resultLen = cipher.processBlock(buf, 0, out, outOff); in processByte()
205 resultLen += cipher.processBlock(buf, 0, out, outOff); in processBytes()
213 resultLen += cipher.processBlock(in, inOff, out, outOff + resultLen); in processBytes()
[all …]
/external/dropbear/libtomcrypt/src/mac/f9/
Df9_init.c27 int f9_init(f9_state *f9, int cipher, const unsigned char *key, unsigned long keylen) in f9_init() argument
35 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in f9_init()
40 if (cipher_descriptor[cipher].block_length % sizeof(LTC_FAST_TYPE)) { in f9_init()
45 if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, &f9->key)) != CRYPT_OK) { in f9_init()
55 zeromem(f9->IV, cipher_descriptor[cipher].block_length); in f9_init()
56 zeromem(f9->ACC, cipher_descriptor[cipher].block_length); in f9_init()
57 f9->blocksize = cipher_descriptor[cipher].block_length; in f9_init()
58 f9->cipher = cipher; in f9_init()
/external/dropbear/libtomcrypt/src/modes/ecb/
Decb_decrypt.c34 if ((err = cipher_is_valid(ecb->cipher)) != CRYPT_OK) { in ecb_decrypt()
37 if (len % cipher_descriptor[ecb->cipher].block_length) { in ecb_decrypt()
42 if (cipher_descriptor[ecb->cipher].accel_ecb_decrypt != NULL) { in ecb_decrypt()
43 …return cipher_descriptor[ecb->cipher].accel_ecb_decrypt(ct, pt, len / cipher_descriptor[ecb->ciphe… in ecb_decrypt()
46 if ((err = cipher_descriptor[ecb->cipher].ecb_decrypt(ct, pt, &ecb->key)) != CRYPT_OK) { in ecb_decrypt()
49 pt += cipher_descriptor[ecb->cipher].block_length; in ecb_decrypt()
50 ct += cipher_descriptor[ecb->cipher].block_length; in ecb_decrypt()
51 len -= cipher_descriptor[ecb->cipher].block_length; in ecb_decrypt()
Decb_encrypt.c34 if ((err = cipher_is_valid(ecb->cipher)) != CRYPT_OK) { in ecb_encrypt()
37 if (len % cipher_descriptor[ecb->cipher].block_length) { in ecb_encrypt()
42 if (cipher_descriptor[ecb->cipher].accel_ecb_encrypt != NULL) { in ecb_encrypt()
43 …return cipher_descriptor[ecb->cipher].accel_ecb_encrypt(pt, ct, len / cipher_descriptor[ecb->ciphe… in ecb_encrypt()
46 if ((err = cipher_descriptor[ecb->cipher].ecb_encrypt(pt, ct, &ecb->key)) != CRYPT_OK) { in ecb_encrypt()
49 pt += cipher_descriptor[ecb->cipher].block_length; in ecb_encrypt()
50 ct += cipher_descriptor[ecb->cipher].block_length; in ecb_encrypt()
51 len -= cipher_descriptor[ecb->cipher].block_length; in ecb_encrypt()

12345678910>>...14