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

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

?? bufferedblockcipher.java

?? 內(nèi)容:基于jdk1.4的加密算法的具體實現(xiàn)
?? JAVA
字號:
package org.bouncycastle.crypto;/** * A wrapper class that allows block ciphers to be used to process data in * a piecemeal fashion. The BufferedBlockCipher outputs a block only when the * buffer is full and more data is being added, or on a doFinal. * <p> * Note: in the case where the underlying cipher is either a CFB cipher or an * OFB one the last block may not be a multiple of the block size. */public class BufferedBlockCipher{    protected byte[]        buf;    protected int           bufOff;    protected boolean       forEncryption;    protected BlockCipher   cipher;    protected boolean       partialBlockOkay;    protected boolean       pgpCFB;    /**     * constructor for subclasses     */    protected BufferedBlockCipher()    {    }    /**     * Create a buffered block cipher without padding.     *     * @param cipher the underlying block cipher this buffering object wraps.     */    public BufferedBlockCipher(        BlockCipher     cipher)    {        this.cipher = cipher;        buf = new byte[cipher.getBlockSize()];        bufOff = 0;        //        // check if we can handle partial blocks on doFinal.        //        String  name = cipher.getAlgorithmName();        int     idx = name.indexOf('/') + 1;        pgpCFB = (idx > 0 && name.startsWith("PGP", idx));        if (pgpCFB)        {            partialBlockOkay = true;        }        else        {            partialBlockOkay = (idx > 0 && (name.startsWith("CFB", idx) || name.startsWith("OFB", idx) || name.startsWith("OpenPGP", idx) || name.startsWith("SIC", idx) || name.startsWith("GCTR", idx)));        }    }    /**     * return the cipher this object wraps.     *     * @return the cipher this object wraps.     */    public BlockCipher getUnderlyingCipher()    {        return cipher;    }    /**     * initialise the cipher.     *     * @param forEncryption if true the cipher is initialised for     *  encryption, if false for decryption.     * @param params the key and other data required by the cipher.     * @exception IllegalArgumentException if the params argument is     * inappropriate.     */    public void init(        boolean             forEncryption,        CipherParameters    params)        throws IllegalArgumentException    {        this.forEncryption = forEncryption;        reset();        cipher.init(forEncryption, params);    }    /**     * return the blocksize for the underlying cipher.     *     * @return the blocksize for the underlying cipher.     */    public int getBlockSize()    {        return cipher.getBlockSize();    }    /**     * 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;        if (pgpCFB)        {            leftOver    = total % buf.length - (cipher.getBlockSize() + 2);        }        else        {            leftOver    = 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)    {        int total       = len + bufOff;        int leftOver;        if (pgpCFB)        {            leftOver    = total % buf.length - (cipher.getBlockSize() + 2);        }        else        {            leftOver    = total % buf.length;            if (leftOver == 0)            {                return total;            }        }        return total - leftOver + buf.length;    }    /**     * 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;        buf[bufOff++] = in;        if (bufOff == buf.length)        {            resultLen = cipher.processBlock(buf, 0, out, outOff);            bufOff = 0;        }        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);            bufOff = 0;            len -= gapLen;            inOff += gapLen;            while (len > buf.length)            {                resultLen += cipher.processBlock(in, inOff, out, outOff + resultLen);                len -= blockSize;                inOff += blockSize;            }        }        System.arraycopy(in, inOff, buf, bufOff, len);        bufOff += len;        if (bufOff == buf.length)        {            resultLen += cipher.processBlock(buf, 0, out, outOff + resultLen);            bufOff = 0;        }        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, or the input is not block size aligned and should be.     * @exception IllegalStateException if the underlying cipher is not     * initialised.     * @exception InvalidCipherTextException if padding is expected and not found.     * @exception DataLengthException if the input is not block size     * aligned.     */    public int doFinal(        byte[]  out,        int     outOff)        throws DataLengthException, IllegalStateException, InvalidCipherTextException    {        int resultLen = 0;        if (outOff + bufOff > out.length)        {            throw new DataLengthException("output buffer too short for doFinal()");        }        if (bufOff != 0 && partialBlockOkay)        {            cipher.processBlock(buf, 0, buf, 0);            resultLen = bufOff;            bufOff = 0;            System.arraycopy(buf, 0, out, outOff, resultLen);        }        else if (bufOff != 0)        {            throw new DataLengthException("data not block size aligned");        }        reset();        return resultLen;    }    /**     * Reset the buffer and cipher. After resetting the object is in the same     * state as it was after the last init (if there was one).     */    public void reset()    {        //        // clean the buffer.        //        for (int i = 0; i < buf.length; i++)        {            buf[i] = 0;        }        bufOff = 0;        //        // reset the underlying cipher.        //        cipher.reset();    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品国产更新| 中文字幕一区视频| 亚洲激情av在线| 在线国产电影不卡| 一区二区三区四区高清精品免费观看 | 一本大道综合伊人精品热热 | 日韩欧美精品在线| 国产真实乱偷精品视频免| 久久综合资源网| 91在线观看免费视频| 亚洲一区二区三区视频在线播放| 91精品国产综合久久精品| 激情五月激情综合网| 狠狠色丁香久久婷婷综合_中| 久久99国内精品| 亚洲人妖av一区二区| 波多野结衣欧美| 亚洲成人精品影院| 欧美国产亚洲另类动漫| 欧美色国产精品| 成a人片亚洲日本久久| 免费在线欧美视频| 综合在线观看色| 午夜成人在线视频| 韩国成人福利片在线播放| 成人高清在线视频| 欧美色精品天天在线观看视频| 欧美一区二区三区在线电影| 国产亚洲欧美中文| 精品日韩一区二区三区免费视频| 在线亚洲人成电影网站色www| 狠狠色狠狠色综合系列| 99国产欧美久久久精品| 成人性视频免费网站| 韩国中文字幕2020精品| 成人app在线观看| 欧美视频一区二区三区在线观看| 欧美成人乱码一区二区三区| 91免费看`日韩一区二区| 欧美日韩中文字幕一区| 国产欧美一区二区三区在线老狼| 欧美日韩久久久久久| 在线精品视频免费观看| 精品少妇一区二区三区在线播放| 国产精品美女久久久久av爽李琼 | 久久国产精品区| 天天综合网天天综合色| 国产91色综合久久免费分享| 国内成人精品2018免费看| 成人a级免费电影| 欧美一级视频精品观看| 日韩一区日韩二区| 国产乱一区二区| 国产一区欧美二区| 国产一区在线视频| 在线不卡一区二区| 日韩精品专区在线| 亚洲一区在线观看网站| 99久久99久久免费精品蜜臀| 精品福利在线导航| 久久综合色天天久久综合图片| 亚洲靠逼com| 成人黄动漫网站免费app| 日韩精品一区二| 日本美女一区二区三区视频| 麻豆久久久久久久| 大胆亚洲人体视频| 26uuu国产日韩综合| 蜜臀久久久久久久| 欧美日韩美少妇| 一区二区三区.www| 色婷婷av一区二区三区软件 | 婷婷国产在线综合| 欧美日韩国产小视频| 亚洲精品久久嫩草网站秘色| av高清久久久| 中文字幕在线观看不卡| 成人午夜免费电影| 国产精品嫩草99a| 成人av午夜电影| 中文字幕亚洲成人| 99视频精品全部免费在线| 成人欧美一区二区三区白人| 99久久国产综合精品麻豆| 亚洲视频每日更新| 欧美视频一区在线| 蜜臀av在线播放一区二区三区| 欧美电影免费观看高清完整版| 理论电影国产精品| 欧美激情在线看| 91在线精品秘密一区二区| 夜夜嗨av一区二区三区网页 | 国产精品久久影院| 天天影视涩香欲综合网| 欧美男男青年gay1069videost| 日韩中文字幕亚洲一区二区va在线 | 成人精品小蝌蚪| 亚洲欧美国产三级| 欧美疯狂做受xxxx富婆| 青青草国产精品97视觉盛宴| 久久久久久久电影| 日韩一区精品视频| 国产日韩精品久久久| 色综合天天综合网天天狠天天 | 国产成人啪免费观看软件| 欧美亚洲动漫精品| 奇米影视在线99精品| 国产欧美日韩三区| 欧美性猛交xxxx黑人交| 日韩成人免费看| 日本一区二区三区四区| 欧美精品国产精品| 粗大黑人巨茎大战欧美成人| 亚洲自拍偷拍麻豆| 亚洲精品在线网站| 91久久精品一区二区三| 久久99精品久久久久久| 亚洲天堂免费在线观看视频| 欧美一区二区网站| 色综合亚洲欧洲| 激情欧美一区二区| 婷婷久久综合九色国产成人 | 日韩成人午夜电影| 亚洲色大成网站www久久九九| 日韩一区二区在线看| 麻豆精品久久精品色综合| 国产精品成人免费在线| 欧美一区二区三区白人| av一区二区三区四区| 国内精品免费在线观看| 日韩国产在线观看一区| 一区二区三区四区乱视频| 国产欧美精品一区aⅴ影院| 日韩欧美色电影| 欧美视频在线播放| 色综合久久综合网97色综合| 国产精品一卡二| 久久精品国产亚洲一区二区三区| 一区二区三区自拍| **性色生活片久久毛片| 国产精品―色哟哟| 国产欧美一区二区精品忘忧草| 欧美一区二区网站| 7777精品久久久大香线蕉| 九色综合狠狠综合久久| 日韩中文字幕不卡| 亚洲va欧美va人人爽| 亚洲最新视频在线观看| 中文字幕一区二区三区乱码在线| 久久精品人人做人人综合| 久久综合五月天婷婷伊人| 日韩欧美专区在线| 日韩一区二区三区视频在线观看| 欧美日韩一区二区三区四区五区| 色综合久久99| 色激情天天射综合网| 欧美性大战xxxxx久久久| 日本韩国欧美国产| 日本电影欧美片| 精品污污网站免费看| 欧美在线一二三四区| 欧美亚日韩国产aⅴ精品中极品| 在线一区二区三区| 欧美精品黑人性xxxx| 日韩精品一区二区三区中文不卡| 日韩欧美精品三级| 国产视频一区在线观看| 国产精品视频观看| 亚洲激情网站免费观看| 天堂在线一区二区| 国产原创一区二区| 成人av在线播放网址| 色综合天天性综合| 欧美精品久久天天躁| 日韩一区二区三区电影在线观看 | 国产原创一区二区三区| 成人激情开心网| 欧美性生活大片视频| 3atv一区二区三区| 久久久一区二区三区| 自拍偷自拍亚洲精品播放| 婷婷综合五月天| 粉嫩高潮美女一区二区三区| 91年精品国产| 日韩欧美一二区| 国产精品日韩精品欧美在线| 亚洲成人午夜电影| 国产精品一区二区免费不卡| 色婷婷av一区二区三区之一色屋| 91精品久久久久久久久99蜜臂| 国产女主播视频一区二区| 亚洲成人动漫av| 国产成人精品综合在线观看| 欧美影院一区二区| 国产亚洲欧美在线| 日韩一区精品视频| 91视频一区二区三区| 日韩欧美精品在线| 亚洲高清免费观看高清完整版在线观看| 亚洲国产精品ⅴa在线观看|