/openjdk7/jdk/test/javax/crypto/Cipher/ |
H A D | ByteBuffers.java | 52 Cipher cipher = Cipher.getInstance("DES/ECB/NoPadding"); 53 cipher.init(Cipher.ENCRYPT_MODE, key); 55 byte[] outBytes = cipher.doFinal(t); 77 crypt(cipher, i1, o1, outBytes, random); 78 crypt(cipher, i2, o1, outBytes, random); 79 crypt(cipher, i3, o1, outBytes, random); 80 crypt(cipher, i1, o2, outBytes, random); 81 crypt(cipher, i2, o2, outBytes, random); 82 crypt(cipher, i3, o2, outBytes, random); 87 private static void crypt(Cipher cipher, ByteBuffe argument [all...] |
/openjdk7/jdk/src/share/classes/javax/crypto/ |
H A D | CipherOutputStream.java | 33 * to the underlying OutputStream. The cipher must be fully 36 * <p> For example, if the cipher is initialized for encryption, the 65 // the cipher engine to use to process stream data 66 private Cipher cipher; field in class:CipherOutputStream 81 * <br>Note: if the specified output stream or cipher is 91 cipher = c; 106 cipher = new NullCipher(); 118 obuffer = cipher.update(ibuffer, 0, 1); 155 obuffer = cipher.update(b, off, len); 164 * that have already been processed by the encapsulated cipher objec [all...] |
H A D | CipherInputStream.java | 68 // the cipher engine to use to process stream data 69 private Cipher cipher; field in class:CipherInputStream 75 underlying stream, but have not been processed by the cipher 82 /* the buffer holding data that have been processed by the cipher 107 obuffer = cipher.doFinal(); 120 obuffer = cipher.update(ibuffer, 0, readin); 132 * <br>Note: if the specified input stream or cipher is 141 cipher = c; 155 cipher = new NullCipher(); 299 cipher [all...] |
H A D | EncryptedPrivateKeyInfo.java | 232 * PKCS8EncodedKeySpec object, <code>cipher</code> needs 237 * @param cipher the initialized cipher object which will be 240 * @exception NullPointerException if <code>cipher</code> 242 * @exception InvalidKeySpecException if the given cipher is 246 public PKCS8EncodedKeySpec getKeySpec(Cipher cipher) argument 250 encoded = cipher.doFinal((byte[])encryptedData); 314 * cipher to decrypt the encrypted data. 341 * cipher to decrypt the encrypted data. 375 * cipher t [all...] |
/openjdk7/jdk/src/share/classes/com/sun/crypto/provider/ |
H A D | CipherTextStealing.java | 32 * This class represents ciphers in cipher text stealing (CTS) mode. 39 * <p>This mode is implemented independently of a particular cipher. 48 * just like all other cipher mode implementations. 74 * The result is stored in <code>cipher</code>, starting at 78 * <code>plainLen</code> is a multiple of the embedded cipher's block size, 84 * @param cipher the buffer for the result 85 * @param cipherOffset the offset in <code>cipher</code> 88 byte[] cipher, int cipherOffset) 94 encrypt(plain, plainOffset, plainLen, cipher, cipherOffset); 99 encrypt(plain, plainOffset, plainLen, cipher, cipherOffse 87 encryptFinal(byte[] plain, int plainOffset, int plainLen, byte[] cipher, int cipherOffset) argument 162 decryptFinal(byte[] cipher, int cipherOffset, int cipherLen, byte[] plain, int plainOffset) argument [all...] |
H A D | SymmetricCipher.java | 32 * intialize the cipher and encrypt/decrypt single blocks. Larger quantities 52 * Retrieves this cipher's block size. 54 * @return the block size of this cipher 59 * Initializes the cipher in the specified mode with the given key. 66 * initializing this cipher 72 * Encrypt one cipher block. 76 * The result is stored in <code>cipher</code>, starting at 81 * @param cipher the buffer for the encryption result 82 * @param cipherOffset the offset in <code>cipher</code> 85 byte[] cipher, in 84 encryptBlock(byte[] plain, int plainOffset, byte[] cipher, int cipherOffset) argument 100 decryptBlock(byte[] cipher, int cipherOffset, byte[] plain, int plainOffset) argument [all...] |
H A D | CipherBlockChaining.java | 31 * This class represents ciphers in cipher block chaining (CBC) mode. 33 * <p>This mode is implemented independently of a particular cipher. 73 * Initializes the cipher in the specified mode with the given key 82 * initializing this cipher 97 * cipher can be reused (with its original iv). 104 * Save the current content of this cipher. 114 * Restores the content of this cipher to the previous saved one. 126 * The result is stored in <code>cipher</code>, starting at 130 * <code>plainLen</code> is a multiple of the embedded cipher's block size, 136 * @param cipher th 139 encrypt(byte[] plain, int plainOffset, int plainLen, byte[] cipher, int cipherOffset) argument 182 decrypt(byte[] cipher, int cipherOffset, int cipherLen, byte[] plain, int plainOffset) argument [all...] |
H A D | CipherFeedback.java | 31 * This class represents ciphers in cipher-feedback (CFB) mode. 33 * <p>This mode is implemented independently of a particular cipher. 56 * of the embedded cipher 83 * Initializes the cipher in the specified mode with the given key 92 * initializing this cipher 101 // always encrypt mode for embedded cipher 108 * cipher can be reused (with its original iv). 115 * Save the current content of this cipher. 125 * Restores the content of this cipher to the previous saved one. 137 * The result is stored in <code>cipher</cod 154 encrypt(byte[] plain, int plainOffset, int plainLen, byte[] cipher, int cipherOffset) argument 222 decrypt(byte[] cipher, int cipherOffset, int cipherLen, byte[] plain, int plainOffset) argument [all...] |
H A D | DESedeCrypt.java | 105 * The result is stored in <code>cipher</code>, starting at 110 * @param cipher the buffer for the result 111 * @param cipherOffset the offset in <code>cipher</code> 114 byte[] cipher, int cipherOffset) 126 cipherBlock(buf2, 0, cipher, cipherOffset); 132 * <p>The input cipher text <code>cipher</code>, starting at 138 * @param cipher the buffer with the input data to be decrypted 143 void decryptBlock(byte[] cipher, int cipherOffset, argument 148 cipherBlock(cipher, cipherOffse 113 encryptBlock(byte[] plain, int plainOffset, byte[] cipher, int cipherOffset) argument [all...] |
H A D | OutputFeedback.java | 33 * <p>This mode is implemented independently of a particular cipher. 55 * of the embedded cipher 82 * Initializes the cipher in the specified mode with the given key 91 * initializing this cipher 100 // always encrypt mode for embedded cipher 107 * cipher can be reused (with its original iv). 114 * Save the current content of this cipher. 124 * Restores the content of this cipher to the previous saved one. 136 * The result is stored in <code>cipher</code>, starting at 150 * @param cipher th 153 encrypt(byte[] plain, int plainOffset, int plainLen, byte[] cipher, int cipherOffset) argument 223 decrypt(byte[] cipher, int cipherOffset, int cipherLen, byte[] plain, int plainOffset) argument [all...] |
H A D | PCBC.java | 34 * <p>This mode is implemented independently of a particular cipher. 68 * Initializes the cipher in the specified mode with the given key 77 * initializing this cipher 92 * cipher can be reused (with its original iv). 99 * Save the current content of this cipher. 110 * Restores the content of this cipher to the previous saved one. 122 * The result is stored in <code>cipher</code>, starting at 126 * <code>plainLen</code> is a multiple of the embedded cipher's block size, 136 * @param cipher the buffer for the result 137 * @param cipherOffset the offset in <code>cipher</cod 139 encrypt(byte[] plain, int plainOffset, int plainLen, byte[] cipher, int cipherOffset) argument 180 decrypt(byte[] cipher, int cipherOffset, int cipherLen, byte[] plain, int plainOffset) argument [all...] |
/openjdk7/jdk/test/com/sun/crypto/provider/Cipher/DES/ |
H A D | DesAPITest.java | 39 Cipher cipher; field in class:DesAPITest 102 cipher = Cipher.getInstance(cipherName.toString()); 112 // retrieve the cipher key 129 cipher.init(Cipher.ENCRYPT_MODE, cipherKey, params); 132 System.out.println("getIV, " + cipher.getIV()); 137 output = cipher.update(input, 0, -1); 146 output = cipher.update(inbuf); 148 len = cipher.getOutputSize(16); 150 output = cipher.doFinal();
|
H A D | PaddingTest.java | 39 Cipher cipher; field in class:PaddingTest 125 cipher = Cipher.getInstance(cipherName.toString()); 134 // retrieve the cipher key 159 cipher.init(Cipher.ENCRYPT_MODE, cipherKey, params); 163 byte[] output = cipher.update(input, 0, len); 168 len = cipher.getOutputSize(0); 171 len = cipher.doFinal(out, 0); 177 cipher.init(Cipher.DECRYPT_MODE, cipherKey, params); 181 output = cipher.update(input, 0, len); 186 len = cipher [all...] |
H A D | PerformanceTest.java | 43 Cipher cipher; field in class:PerformanceTest 158 cipher = Cipher.getInstance(cipherName.toString()); 168 // retrieve the cipher key 181 cipher.init(Cipher.ENCRYPT_MODE, cipherKey, params); 185 cipher.update(data, 0, data.length); 187 cipher.doFinal(data, 0, data.length);
|
/openjdk7/jdk/src/share/classes/sun/security/krb5/internal/crypto/ |
H A D | DesCbcCrcEType.java | 66 * @param key the secret key to encrypt the data. It is also used as initialization vector during cipher block chaining. 67 * @return the buffer for cipher text. 78 * @param cipher the cipher text to be decrypted. 83 public byte[] decrypt(byte[] cipher, byte[] key, int usage) argument 85 return decrypt(cipher, key, key, usage);
|
H A D | Aes128CtsHmacSha1EType.java | 91 public byte[] decrypt(byte[] cipher, byte[] key, int usage) argument 94 return decrypt(cipher, key, ivec, usage); 97 public byte[] decrypt(byte[] cipher, byte[] key, byte[] ivec, int usage) argument 100 return Aes128.decrypt(key, usage, ivec, cipher, 0, cipher.length);
|
H A D | Aes256CtsHmacSha1EType.java | 91 public byte[] decrypt(byte[] cipher, byte[] key, int usage) argument 94 return decrypt(cipher, key, ivec, usage); 97 public byte[] decrypt(byte[] cipher, byte[] key, byte[] ivec, int usage) argument 100 return Aes256.decrypt(key, usage, ivec, cipher, 0, cipher.length);
|
H A D | ArcFourHmacEType.java | 91 public byte[] decrypt(byte[] cipher, byte[] key, int usage) argument 94 return decrypt(cipher, key, ivec, usage); 97 public byte[] decrypt(byte[] cipher, byte[] key, byte[] ivec, int usage) argument 100 return ArcFourHmac.decrypt(key, usage, ivec, cipher, 0, cipher.length);
|
H A D | Des3CbcHmacSha1KdEType.java | 85 public byte[] decrypt(byte[] cipher, byte[] key, int usage) argument 88 return decrypt(cipher, key, ivec, usage); 91 public byte[] decrypt(byte[] cipher, byte[] key, byte[] ivec, int usage) argument 94 return Des3.decrypt(key, usage, ivec, cipher, 0, cipher.length);
|
H A D | DesCbcEType.java | 120 byte[] cipher = new byte[new_data.length]; 121 Des.cbc_encrypt(new_data, cipher, key, ivec, true); 122 return cipher; 127 * @param cipher the input buffer. 132 public byte[] decrypt(byte[] cipher, byte[] key, int usage) argument 135 return decrypt(cipher, key, ivec, usage); 140 * @param cipher the input buffer. 146 public byte[] decrypt(byte[] cipher, byte[] key, byte[] ivec, int usage) argument 161 byte[] data = new byte[cipher.length]; 162 Des.cbc_encrypt(cipher, dat [all...] |
H A D | NullEType.java | 74 byte[] cipher = new byte[data.length]; 75 System.arraycopy(data, 0, cipher, 0, data.length); 76 return cipher; 80 byte[] cipher = new byte[data.length]; 81 System.arraycopy(data, 0, cipher, 0, data.length); 82 return cipher; 85 public byte[] decrypt(byte[] cipher, byte[] key, int usage) argument 87 return cipher.clone(); 90 public byte[] decrypt(byte[] cipher, byte[] key, byte[] ivec, int usage) argument 92 return cipher [all...] |
/openjdk7/jdk/test/javax/crypto/CipherSpi/ |
H A D | DirectBBRemaining.java | 42 * process the data internally buffered inBB the cipher when input.remaining() 59 Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding", "SunJCE"); 60 cipher.init(Cipher.ENCRYPT_MODE, key); 77 int outSize = cipher.getOutputSize(size); 80 encrypt(cipher, size, 92 // testing and reset the cipher to a known good state. 93 cipher.init(Cipher.ENCRYPT_MODE, key); 107 private static void encrypt(Cipher cipher, int size, argument 118 byte[] expected = cipher.doFinal(testdata); 152 cipher [all...] |
/openjdk7/jdk/test/javax/crypto/EncryptedPrivateKeyInfo/ |
H A D | GetKeySpecException.java | 43 private static Cipher cipher = null; field in class:GetKeySpecException
|
/openjdk7/jdk/test/sun/security/pkcs11/Cipher/ |
H A D | TestSymmCiphers.java | 133 private static void test(Cipher cipher, int mode, SecretKey key, argument 138 cipher.init(mode, key, params); 139 int outLen = cipher.getOutputSize(in.length); 158 byte[] temp = cipher.update(in, 0, firstBlkSize); 162 temp = cipher.doFinal(in, firstBlkSize, in.length - firstBlkSize); 178 cipher.update(inBuf, outBuf); 179 cipher.doFinal(inBuf, outBuf); 191 cipher.update(inDirectBuf, outDirectBuf); 192 cipher.doFinal(inDirectBuf, outDirectBuf); 209 cipher [all...] |
H A D | TestSymmCiphersNoPad.java | 112 private static void test(Cipher cipher, int mode, SecretKey key, argument 117 cipher.init(mode, key, params); 118 int outLen = cipher.getOutputSize(in.length); 134 byte[] testOut1 = cipher.update(in, 0, 16); 136 testOut1 = cipher.doFinal(in, 16, in.length-16); 145 cipher.update(inBuf, outBuf); 146 cipher.doFinal(inBuf, outBuf); 153 cipher.update(inDirectBuf, outDirectBuf); 154 cipher.doFinal(inDirectBuf, outDirectBuf); 166 cipher [all...] |