亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ctsblockcipher.java

?? 內容:基于jdk1.4的加密算法的具體實現
?? JAVA
字號:
package org.bouncycastle.crypto.modes;import org.bouncycastle.crypto.BlockCipher;import org.bouncycastle.crypto.BufferedBlockCipher;import org.bouncycastle.crypto.DataLengthException;import org.bouncycastle.crypto.InvalidCipherTextException;/** * A Cipher Text Stealing (CTS) mode cipher. CTS allows block ciphers to * be used to produce cipher text which is the same length as the plain text. */public class CTSBlockCipher    extends BufferedBlockCipher{    private int     blockSize;    /**     * Create a buffered block cipher that uses Cipher Text Stealing     *     * @param cipher the underlying block cipher this buffering object wraps.     */    public CTSBlockCipher(        BlockCipher     cipher)    {        if ((cipher instanceof OFBBlockCipher) || (cipher instanceof CFBBlockCipher))        {            throw new IllegalArgumentException("CTSBlockCipher can only accept ECB, or CBC ciphers");        }        this.cipher = cipher;        blockSize = cipher.getBlockSize();        buf = new byte[blockSize * 2];        bufOff = 0;    }    /**     * return the size of the output buffer required for an update      * an input of len bytes.     *     * @param len the length of the input.     * @return the space required to accommodate a call to update     * with len bytes of input.     */    public int getUpdateOutputSize(        int len)    {        int total       = len + bufOff;        int leftOver    = total % buf.length;        if (leftOver == 0)        {            return total - buf.length;        }        return total - leftOver;    }    /**     * return the size of the output buffer required for an update plus a     * doFinal with an input of len bytes.     *     * @param len the length of the input.     * @return the space required to accommodate a call to update and doFinal     * with len bytes of input.     */    public int getOutputSize(        int len)    {        return len + bufOff;    }    /**     * process a single byte, producing an output block if neccessary.     *     * @param in the input byte.     * @param out the space for any output that might be produced.     * @param outOff the offset from which the output will be copied.     * @return the number of output bytes copied to out.     * @exception DataLengthException if there isn't enough space in out.     * @exception IllegalStateException if the cipher isn't initialised.     */    public int processByte(        byte        in,        byte[]      out,        int         outOff)        throws DataLengthException, IllegalStateException    {        int         resultLen = 0;        if (bufOff == buf.length)        {            resultLen = cipher.processBlock(buf, 0, out, outOff);            System.arraycopy(buf, blockSize, buf, 0, blockSize);            bufOff = blockSize;        }        buf[bufOff++] = in;        return resultLen;    }    /**     * process an array of bytes, producing output if necessary.     *     * @param in the input byte array.     * @param inOff the offset at which the input data starts.     * @param len the number of bytes to be copied out of the input array.     * @param out the space for any output that might be produced.     * @param outOff the offset from which the output will be copied.     * @return the number of output bytes copied to out.     * @exception DataLengthException if there isn't enough space in out.     * @exception IllegalStateException if the cipher isn't initialised.     */    public int processBytes(        byte[]      in,        int         inOff,        int         len,        byte[]      out,        int         outOff)        throws DataLengthException, IllegalStateException    {        if (len < 0)        {            throw new IllegalArgumentException("Can't have a negative input length!");        }        int blockSize   = getBlockSize();        int length      = getUpdateOutputSize(len);                if (length > 0)        {            if ((outOff + length) > out.length)            {                throw new DataLengthException("output buffer too short");            }        }        int resultLen = 0;        int gapLen = buf.length - bufOff;        if (len > gapLen)        {            System.arraycopy(in, inOff, buf, bufOff, gapLen);            resultLen += cipher.processBlock(buf, 0, out, outOff);            System.arraycopy(buf, blockSize, buf, 0, blockSize);            bufOff = blockSize;            len -= gapLen;            inOff += gapLen;            while (len > blockSize)            {                System.arraycopy(in, inOff, buf, bufOff, blockSize);                resultLen += cipher.processBlock(buf, 0, out, outOff + resultLen);                System.arraycopy(buf, blockSize, buf, 0, blockSize);                len -= blockSize;                inOff += blockSize;            }        }        System.arraycopy(in, inOff, buf, bufOff, len);        bufOff += len;        return resultLen;    }    /**     * Process the last block in the buffer.     *     * @param out the array the block currently being held is copied into.     * @param outOff the offset at which the copying starts.     * @return the number of output bytes copied to out.     * @exception DataLengthException if there is insufficient space in out for     * the output.     * @exception IllegalStateException if the underlying cipher is not     * initialised.     * @exception InvalidCipherTextException if cipher text decrypts wrongly (in     * case the exception will never get thrown).     */    public int doFinal(        byte[]  out,        int     outOff)        throws DataLengthException, IllegalStateException, InvalidCipherTextException    {        if (bufOff + outOff > out.length)        {            throw new DataLengthException("output buffer to small in doFinal");        }        int     blockSize = cipher.getBlockSize();        int     len = bufOff - blockSize;        byte[]  block = new byte[blockSize];        if (forEncryption)        {            cipher.processBlock(buf, 0, block, 0);                        if (bufOff < blockSize)            {                throw new DataLengthException("need at least one block of input for CTS");            }            for (int i = bufOff; i != buf.length; i++)            {                buf[i] = block[i - blockSize];            }            for (int i = blockSize; i != bufOff; i++)            {                buf[i] ^= block[i - blockSize];            }            if (cipher instanceof CBCBlockCipher)            {                BlockCipher c = ((CBCBlockCipher)cipher).getUnderlyingCipher();                c.processBlock(buf, blockSize, out, outOff);            }            else            {                cipher.processBlock(buf, blockSize, out, outOff);            }            System.arraycopy(block, 0, out, outOff + blockSize, len);        }        else        {            byte[]  lastBlock = new byte[blockSize];            if (cipher instanceof CBCBlockCipher)            {                BlockCipher c = ((CBCBlockCipher)cipher).getUnderlyingCipher();                c.processBlock(buf, 0, block, 0);            }            else            {                cipher.processBlock(buf, 0, block, 0);            }            for (int i = blockSize; i != bufOff; i++)            {                lastBlock[i - blockSize] = (byte)(block[i - blockSize] ^ buf[i]);            }            System.arraycopy(buf, blockSize, block, 0, len);            cipher.processBlock(block, 0, out, outOff);            System.arraycopy(lastBlock, 0, out, outOff + blockSize, len);        }        int offset = bufOff;        reset();        return offset;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产传媒日韩欧美成人| 国产**成人网毛片九色| 国产精品伊人色| 欧美在线观看视频在线| 久久婷婷综合激情| 亚洲bt欧美bt精品| 91片在线免费观看| 欧美激情一区在线| 久久国产剧场电影| 欧美日韩另类一区| 亚洲人成在线观看一区二区| 韩国av一区二区三区在线观看| 欧美日韩中文字幕一区二区| 精品嫩草影院久久| 日本欧美肥老太交大片| 欧美亚洲动漫另类| 亚洲少妇30p| 成人精品小蝌蚪| 久久亚洲免费视频| 精品一区二区免费在线观看| 91精品免费在线| 天天综合网 天天综合色| 色偷偷成人一区二区三区91| 国产精品欧美一区喷水| 国产一区二区三区在线看麻豆| 欧美一区二区三区视频免费| 亚洲成人一区在线| 欧美精品123区| 水野朝阳av一区二区三区| 91成人免费在线| 亚洲精品videosex极品| 色婷婷av一区二区三区gif| 国产精品美女www爽爽爽| 成人h动漫精品一区二区| 国产精品视频线看| 99久久伊人精品| 一区二区在线观看免费视频播放| 99久久精品99国产精品| 一区二区三区自拍| 欧美日韩亚洲国产综合| 视频一区视频二区中文| 欧美肥胖老妇做爰| 美日韩一区二区三区| xnxx国产精品| 国产成a人亚洲| 自拍av一区二区三区| 欧美亚男人的天堂| 三级成人在线视频| 精品国内片67194| 成熟亚洲日本毛茸茸凸凹| 国产精品久久久久久户外露出| aaa欧美日韩| 亚洲午夜成aⅴ人片| 欧美大片顶级少妇| 国产suv精品一区二区三区| 国产精品福利一区| 欧美三级三级三级| 精品一区二区在线视频| 国产午夜亚洲精品不卡| 色又黄又爽网站www久久| 五月婷婷欧美视频| 久久男人中文字幕资源站| 91丨porny丨蝌蚪视频| 午夜精品福利久久久| 久久久av毛片精品| 日本高清免费不卡视频| 久久国产综合精品| 国产精品成人免费精品自在线观看| 91久久一区二区| 精品一区二区三区在线观看国产 | www国产成人免费观看视频 深夜成人网 | 亚洲一区二区三区免费视频| 欧美大片在线观看一区| 91免费观看视频| 美女视频免费一区| 玉米视频成人免费看| 欧美xfplay| 欧美日韩三级一区| av高清久久久| 久久电影国产免费久久电影| 中文字幕一区二| 日韩精品专区在线| 欧美性大战久久久久久久| 国产传媒一区在线| 免费看日韩a级影片| 亚洲综合偷拍欧美一区色| 日本一区二区综合亚洲| 欧美一区二区在线看| 色综合天天视频在线观看| 国产一区二区三区免费观看| 日本亚洲欧美天堂免费| 一区二区三区欧美激情| 中文一区一区三区高中清不卡| 91.com在线观看| 在线观看日韩国产| 99久久精品免费| 国产成人鲁色资源国产91色综 | 亚洲欧美日韩综合aⅴ视频| 欧美xxxxxxxx| 日韩欧美综合在线| 欧美剧情片在线观看| 日本黄色一区二区| 99免费精品在线观看| 丁香激情综合五月| 成人免费视频视频| 成人在线视频一区| 成人午夜电影久久影院| 国产精品一区二区果冻传媒| 久久国产精品99精品国产| 免费成人在线视频观看| 三级久久三级久久久| 日韩国产精品久久久| 全部av―极品视觉盛宴亚洲| 亚洲第一会所有码转帖| 亚洲国产中文字幕| 午夜日韩在线观看| 天堂久久久久va久久久久| 首页国产欧美日韩丝袜| 首页综合国产亚洲丝袜| 水野朝阳av一区二区三区| 免费看黄色91| 欧美日本不卡视频| 一本色道久久综合亚洲91| 不卡的电视剧免费网站有什么| 国产成人午夜视频| 波多野结衣亚洲一区| 成人av电影在线| 91丨porny丨最新| 欧美日韩久久久一区| 在线综合亚洲欧美在线视频| 欧美一区二区三区婷婷月色| 日韩一级二级三级| 久久久久久久精| 最新不卡av在线| 亚洲妇女屁股眼交7| 免费在线成人网| 国产成人av在线影院| 99国产麻豆精品| 在线成人午夜影院| 久久综合视频网| 亚洲日韩欧美一区二区在线| 亚洲一区二区在线播放相泽| 天天综合色天天综合色h| 国产综合久久久久影院| 暴力调教一区二区三区| 欧美日韩三级视频| 久久女同精品一区二区| 一区二区三区四区在线播放| 琪琪久久久久日韩精品| 岛国av在线一区| 欧美日韩激情一区二区三区| 欧美精品一区二区不卡| 亚洲精品中文在线| 国产做a爰片久久毛片| 在线观看欧美日本| 久久这里只有精品视频网| 亚洲精品视频在线看| 国内精品自线一区二区三区视频| bt7086福利一区国产| 欧美一区二区三区播放老司机| 中文字幕av不卡| 免费成人你懂的| 91福利国产成人精品照片| 久久久久久久综合| 午夜成人免费视频| aaa亚洲精品| wwwwww.欧美系列| 亚洲成av人综合在线观看| 高清国产一区二区| 日韩欧美国产系列| 亚洲最色的网站| 成人动漫一区二区| 2020国产精品久久精品美国| 亚洲h动漫在线| 91浏览器在线视频| 国产日韩欧美激情| 麻豆国产精品一区二区三区| 欧美亚日韩国产aⅴ精品中极品| 久久免费视频一区| 美女脱光内衣内裤视频久久影院| 色欧美片视频在线观看在线视频| 国产日韩成人精品| 国产在线视频精品一区| 在线播放91灌醉迷j高跟美女 | 日韩一级欧美一级| 性欧美疯狂xxxxbbbb| 色偷偷一区二区三区| 亚洲欧洲99久久| 成人高清视频免费观看| 欧美国产精品久久| 国产一区二区在线视频| 欧美r级在线观看| 奇米777欧美一区二区| 欧美日韩亚洲综合| 亚洲图片一区二区| 欧美色视频一区| 亚洲妇熟xx妇色黄| 91精品婷婷国产综合久久竹菊| 亚洲va天堂va国产va久| 欧美在线999|