jdk/src/share/classes/com/sun/crypto/provider/PCBC.java
changeset 10336 0bb1999251f8
parent 5506 202f599c92aa
child 20752 f0f0acea9113
equal deleted inserted replaced
10335:3c7eda3ab2f5 10336:0bb1999251f8
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   143         int endIndex = plainOffset + plainLen;
   143         int endIndex = plainOffset + plainLen;
   144 
   144 
   145         for (; plainOffset < endIndex;
   145         for (; plainOffset < endIndex;
   146              plainOffset += blockSize, cipherOffset += blockSize) {
   146              plainOffset += blockSize, cipherOffset += blockSize) {
   147             for (i=0; i<blockSize; i++) {
   147             for (i=0; i<blockSize; i++) {
   148                 k[i] ^= (byte)(plain[i+plainOffset]);
   148                 k[i] ^= plain[i+plainOffset];
   149             }
   149             }
   150             embeddedCipher.encryptBlock(k, 0, cipher, cipherOffset);
   150             embeddedCipher.encryptBlock(k, 0, cipher, cipherOffset);
   151             for (i = 0; i < blockSize; i++) {
   151             for (i = 0; i < blockSize; i++) {
   152                 k[i] = (byte)(plain[i+plainOffset] ^ cipher[i+cipherOffset]);
   152                 k[i] = (byte)(plain[i+plainOffset] ^ cipher[i+cipherOffset]);
   153             }
   153             }