|
45 | 45 | import java.security.interfaces.RSAPrivateKey;
|
46 | 46 | import java.security.interfaces.RSAPublicKey;
|
47 | 47 |
|
48 |
| -import com.wolfssl.wolfcrypt.WolfCrypt; |
49 |
| -import com.wolfssl.wolfcrypt.Asn; |
50 | 48 | import com.wolfssl.wolfcrypt.Aes;
|
51 | 49 | import com.wolfssl.wolfcrypt.AesGcm;
|
52 | 50 | import com.wolfssl.wolfcrypt.Des3;
|
53 | 51 | import com.wolfssl.wolfcrypt.Rsa;
|
54 | 52 | import com.wolfssl.wolfcrypt.Rng;
|
55 | 53 |
|
56 |
| -import com.wolfssl.provider.jce.WolfCryptDebug; |
57 |
| - |
58 | 54 | /**
|
59 | 55 | * wolfCrypt JCE Cipher (AES, 3DES) wrapper
|
60 | 56 | */
|
@@ -144,6 +140,9 @@ private WolfCryptCipher(CipherType type, CipherMode mode,
|
144 | 140 | case WC_DES3:
|
145 | 141 | blockSize = Des3.BLOCK_SIZE;
|
146 | 142 | break;
|
| 143 | + |
| 144 | + case WC_RSA: |
| 145 | + break; |
147 | 146 | }
|
148 | 147 |
|
149 | 148 | if (WolfCryptDebug.DEBUG) {
|
@@ -450,8 +449,6 @@ private void wolfCryptSetIV(AlgorithmParameterSpec spec,
|
450 | 449 | private void wolfCryptSetKey(Key key)
|
451 | 450 | throws InvalidKeyException {
|
452 | 451 |
|
453 |
| - int ret = 0; |
454 |
| - long[] idx = {0}; |
455 | 452 | byte[] encodedKey;
|
456 | 453 |
|
457 | 454 | /* validate key class type */
|
@@ -611,27 +608,10 @@ private boolean isBlockCipher() {
|
611 | 608 | return isBlockCipher;
|
612 | 609 | }
|
613 | 610 |
|
614 |
| - /* return 1 if cipher is a block cipher and lenth is a block |
615 |
| - * length multiple, otherwise 0 */ |
616 |
| - private int isValidBlockLength(int length) { |
617 |
| - |
618 |
| - /* skip if not a block cipher */ |
619 |
| - if (isBlockCipher() == false) { |
620 |
| - return 1; |
621 |
| - } |
622 |
| - |
623 |
| - if ((length % this.blockSize) != 0) { |
624 |
| - return 0; |
625 |
| - } |
626 |
| - |
627 |
| - return 1; |
628 |
| - } |
629 |
| - |
630 | 611 | private byte[] wolfCryptUpdate(byte[] input, int inputOffset, int len)
|
631 | 612 | throws IllegalArgumentException {
|
632 | 613 |
|
633 | 614 | int blocks = 0;
|
634 |
| - int remaining = 0; |
635 | 615 | int bytesToProcess = 0;
|
636 | 616 | byte[] output = null;
|
637 | 617 | byte[] tmpIn = null;
|
@@ -666,7 +646,6 @@ private byte[] wolfCryptUpdate(byte[] input, int inputOffset, int len)
|
666 | 646 |
|
667 | 647 | /* calculate blocks and partial non-block size remaining */
|
668 | 648 | blocks = buffered.length / blockSize;
|
669 |
| - remaining = buffered.length % blockSize; |
670 | 649 | bytesToProcess = blocks * blockSize;
|
671 | 650 |
|
672 | 651 | /* if PKCS#5/7 padding, and decrypting, hold on to last block for
|
|
0 commit comments