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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? whirlpooldigest.java

?? 內(nèi)容:基于jdk1.4的加密算法的具體實現(xiàn)
?? JAVA
字號:
package org.bouncycastle.crypto.digests;import org.bouncycastle.crypto.ExtendedDigest;import org.bouncycastle.util.Arrays;/** * Implementation of WhirlpoolDigest, based on Java source published by Barreto * and Rijmen. *   */public final class WhirlpoolDigest     implements ExtendedDigest{    private static final int BYTE_LENGTH = 64;        private static final int DIGEST_LENGTH_BYTES = 512 / 8;    private static final int ROUNDS = 10;    private static final int REDUCTION_POLYNOMIAL = 0x011d; // 2^8 + 2^4 + 2^3 + 2 + 1;    private static final int[] SBOX = {        0x18, 0x23, 0xc6, 0xe8, 0x87, 0xb8, 0x01, 0x4f, 0x36, 0xa6, 0xd2, 0xf5, 0x79, 0x6f, 0x91, 0x52,        0x60, 0xbc, 0x9b, 0x8e, 0xa3, 0x0c, 0x7b, 0x35, 0x1d, 0xe0, 0xd7, 0xc2, 0x2e, 0x4b, 0xfe, 0x57,        0x15, 0x77, 0x37, 0xe5, 0x9f, 0xf0, 0x4a, 0xda, 0x58, 0xc9, 0x29, 0x0a, 0xb1, 0xa0, 0x6b, 0x85,        0xbd, 0x5d, 0x10, 0xf4, 0xcb, 0x3e, 0x05, 0x67, 0xe4, 0x27, 0x41, 0x8b, 0xa7, 0x7d, 0x95, 0xd8,        0xfb, 0xee, 0x7c, 0x66, 0xdd, 0x17, 0x47, 0x9e, 0xca, 0x2d, 0xbf, 0x07, 0xad, 0x5a, 0x83, 0x33,        0x63, 0x02, 0xaa, 0x71, 0xc8, 0x19, 0x49, 0xd9, 0xf2, 0xe3, 0x5b, 0x88, 0x9a, 0x26, 0x32, 0xb0,        0xe9, 0x0f, 0xd5, 0x80, 0xbe, 0xcd, 0x34, 0x48, 0xff, 0x7a, 0x90, 0x5f, 0x20, 0x68, 0x1a, 0xae,        0xb4, 0x54, 0x93, 0x22, 0x64, 0xf1, 0x73, 0x12, 0x40, 0x08, 0xc3, 0xec, 0xdb, 0xa1, 0x8d, 0x3d,        0x97, 0x00, 0xcf, 0x2b, 0x76, 0x82, 0xd6, 0x1b, 0xb5, 0xaf, 0x6a, 0x50, 0x45, 0xf3, 0x30, 0xef,        0x3f, 0x55, 0xa2, 0xea, 0x65, 0xba, 0x2f, 0xc0, 0xde, 0x1c, 0xfd, 0x4d, 0x92, 0x75, 0x06, 0x8a,        0xb2, 0xe6, 0x0e, 0x1f, 0x62, 0xd4, 0xa8, 0x96, 0xf9, 0xc5, 0x25, 0x59, 0x84, 0x72, 0x39, 0x4c,        0x5e, 0x78, 0x38, 0x8c, 0xd1, 0xa5, 0xe2, 0x61, 0xb3, 0x21, 0x9c, 0x1e, 0x43, 0xc7, 0xfc, 0x04,        0x51, 0x99, 0x6d, 0x0d, 0xfa, 0xdf, 0x7e, 0x24, 0x3b, 0xab, 0xce, 0x11, 0x8f, 0x4e, 0xb7, 0xeb,        0x3c, 0x81, 0x94, 0xf7, 0xb9, 0x13, 0x2c, 0xd3, 0xe7, 0x6e, 0xc4, 0x03, 0x56, 0x44, 0x7f, 0xa9,        0x2a, 0xbb, 0xc1, 0x53, 0xdc, 0x0b, 0x9d, 0x6c, 0x31, 0x74, 0xf6, 0x46, 0xac, 0x89, 0x14, 0xe1,        0x16, 0x3a, 0x69, 0x09, 0x70, 0xb6, 0xd0, 0xed, 0xcc, 0x42, 0x98, 0xa4, 0x28, 0x5c, 0xf8, 0x86    };        private static final long[] C0 = new long[256];    private static final long[] C1 = new long[256];    private static final long[] C2 = new long[256];    private static final long[] C3 = new long[256];    private static final long[] C4 = new long[256];    private static final long[] C5 = new long[256];    private static final long[] C6 = new long[256];    private static final long[] C7 = new long[256];    private final long[] _rc = new long[ROUNDS + 1];            public WhirlpoolDigest()    {        for (int i = 0; i < 256; i++)        {            int v1 = SBOX[i];            int v2 = maskWithReductionPolynomial(v1 << 1);            int v4 = maskWithReductionPolynomial(v2 << 1);            int v5 = v4 ^ v1;            int v8 = maskWithReductionPolynomial(v4 << 1);            int v9 = v8 ^ v1;                        C0[i] = packIntoLong(v1, v1, v4, v1, v8, v5, v2, v9);            C1[i] = packIntoLong(v9, v1, v1, v4, v1, v8, v5, v2);            C2[i] = packIntoLong(v2, v9, v1, v1, v4, v1, v8, v5);            C3[i] = packIntoLong(v5, v2, v9, v1, v1, v4, v1, v8);            C4[i] = packIntoLong(v8, v5, v2, v9, v1, v1, v4, v1);            C5[i] = packIntoLong(v1, v8, v5, v2, v9, v1, v1, v4);            C6[i] = packIntoLong(v4, v1, v8, v5, v2, v9, v1, v1);            C7[i] = packIntoLong(v1, v4, v1, v8, v5, v2, v9, v1);                    }                _rc[0] = 0L;        for (int r = 1; r <= ROUNDS; r++)        {            int i = 8 * (r - 1);            _rc[r] =    (C0[i    ] & 0xff00000000000000L) ^                         (C1[i + 1] & 0x00ff000000000000L) ^                         (C2[i + 2] & 0x0000ff0000000000L) ^                        (C3[i + 3] & 0x000000ff00000000L) ^                         (C4[i + 4] & 0x00000000ff000000L) ^                        (C5[i + 5] & 0x0000000000ff0000L) ^                        (C6[i + 6] & 0x000000000000ff00L) ^                         (C7[i + 7] & 0x00000000000000ffL);        }            }    private long packIntoLong(int b7, int b6, int b5, int b4, int b3, int b2, int b1, int b0)    {        return                     ((long)b7 << 56) ^                    ((long)b6 << 48) ^                    ((long)b5 << 40) ^                    ((long)b4 << 32) ^                    ((long)b3 << 24) ^                    ((long)b2 << 16) ^                    ((long)b1 <<  8) ^                    b0;    }    /*     * int's are used to prevent sign extension.  The values that are really being used are     * actually just 0..255     */    private int maskWithReductionPolynomial(int input)    {        int rv = input;        if (rv >= 0x100L) // high bit set        {            rv ^= REDUCTION_POLYNOMIAL; // reduced by the polynomial        }        return rv;    }            // --------------------------------------------------------------------------------------//        // -- buffer information --    private static final int BITCOUNT_ARRAY_SIZE = 32;    private byte[]  _buffer    = new byte[64];    private int     _bufferPos = 0;    private short[] _bitCount  = new short[BITCOUNT_ARRAY_SIZE];        // -- internal hash state --    private long[] _hash  = new long[8];    private long[] _K = new long[8]; // the round key    private long[] _L = new long[8];    private long[] _block = new long[8]; // mu (buffer)    private long[] _state = new long[8]; // the current "cipher" state        /**     * Copy constructor. This will copy the state of the provided message     * digest.     */    public WhirlpoolDigest(WhirlpoolDigest originalDigest)    {        System.arraycopy(originalDigest._rc, 0, _rc, 0, _rc.length);                System.arraycopy(originalDigest._buffer, 0, _buffer, 0, _buffer.length);                this._bufferPos = originalDigest._bufferPos;        System.arraycopy(originalDigest._bitCount, 0, _bitCount, 0, _bitCount.length);                // -- internal hash state --        System.arraycopy(originalDigest._hash, 0, _hash, 0, _hash.length);        System.arraycopy(originalDigest._K, 0, _K, 0, _K.length);        System.arraycopy(originalDigest._L, 0, _L, 0, _L.length);        System.arraycopy(originalDigest._block, 0, _block, 0, _block.length);        System.arraycopy(originalDigest._state, 0, _state, 0, _state.length);     }    public String getAlgorithmName()    {        return "Whirlpool";    }    public int getDigestSize()    {        return DIGEST_LENGTH_BYTES;    }    public int doFinal(byte[] out, int outOff)    {        // sets out[outOff] .. out[outOff+DIGEST_LENGTH_BYTES]        finish();        for (int i = 0; i < 8; i++)        {            convertLongToByteArray(_hash[i], out, outOff + (i * 8));        }        reset();                return getDigestSize();    }        /**     * reset the chaining variables     */    public void reset()    {        // set variables to null, blank, whatever        _bufferPos = 0;        Arrays.fill(_bitCount, (short)0);        Arrays.fill(_buffer, (byte)0);        Arrays.fill(_hash, 0);        Arrays.fill(_K, 0);        Arrays.fill(_L, 0);        Arrays.fill(_block, 0);        Arrays.fill(_state, 0);    }    // this takes a buffer of information and fills the block    private void processFilledBuffer(byte[] in, int inOff)    {        // copies into the block...        for (int i = 0; i < _state.length; i++)        {            _block[i] = bytesToLongFromBuffer(_buffer, i * 8);        }        processBlock();        _bufferPos = 0;        Arrays.fill(_buffer, (byte)0);    }    private long bytesToLongFromBuffer(byte[] buffer, int startPos)    {        long rv = (((buffer[startPos + 0] & 0xffL) << 56) |                   ((buffer[startPos + 1] & 0xffL) << 48) |                   ((buffer[startPos + 2] & 0xffL) << 40) |                   ((buffer[startPos + 3] & 0xffL) << 32) |                   ((buffer[startPos + 4] & 0xffL) << 24) |                   ((buffer[startPos + 5] & 0xffL) << 16) |                   ((buffer[startPos + 6] & 0xffL) <<  8) |                   ((buffer[startPos + 7]) & 0xffL));                return rv;    }    private void convertLongToByteArray(long inputLong, byte[] outputArray, int offSet)    {        for (int i = 0; i < 8; i++)        {            outputArray[offSet + i] = (byte)((inputLong >> (56 - (i * 8))) & 0xff);        }    }    protected void processBlock()    {        // buffer contents have been transferred to the _block[] array via        // processFilledBuffer                // compute and apply K^0        for (int i = 0; i < 8; i++)        {            _state[i] = _block[i] ^ (_K[i] = _hash[i]);        }        // iterate over the rounds        for (int round = 1; round <= ROUNDS; round++)        {            for (int i = 0; i < 8; i++)            {                _L[i] = 0;                _L[i] ^= C0[(int)(_K[(i - 0) & 7] >>> 56) & 0xff];                _L[i] ^= C1[(int)(_K[(i - 1) & 7] >>> 48) & 0xff];                _L[i] ^= C2[(int)(_K[(i - 2) & 7] >>> 40) & 0xff];                _L[i] ^= C3[(int)(_K[(i - 3) & 7] >>> 32) & 0xff];                _L[i] ^= C4[(int)(_K[(i - 4) & 7] >>> 24) & 0xff];                _L[i] ^= C5[(int)(_K[(i - 5) & 7] >>> 16) & 0xff];                _L[i] ^= C6[(int)(_K[(i - 6) & 7] >>>  8) & 0xff];                _L[i] ^= C7[(int)(_K[(i - 7) & 7]) & 0xff];            }            System.arraycopy(_L, 0, _K, 0, _K.length);                        _K[0] ^= _rc[round];                        // apply the round transformation            for (int i = 0; i < 8; i++)            {                _L[i] = _K[i];                                _L[i] ^= C0[(int)(_state[(i - 0) & 7] >>> 56) & 0xff];                _L[i] ^= C1[(int)(_state[(i - 1) & 7] >>> 48) & 0xff];                _L[i] ^= C2[(int)(_state[(i - 2) & 7] >>> 40) & 0xff];                _L[i] ^= C3[(int)(_state[(i - 3) & 7] >>> 32) & 0xff];                _L[i] ^= C4[(int)(_state[(i - 4) & 7] >>> 24) & 0xff];                _L[i] ^= C5[(int)(_state[(i - 5) & 7] >>> 16) & 0xff];                _L[i] ^= C6[(int)(_state[(i - 6) & 7] >>> 8) & 0xff];                _L[i] ^= C7[(int)(_state[(i - 7) & 7]) & 0xff];            }                        // save the current state            System.arraycopy(_L, 0, _state, 0, _state.length);        }                // apply Miuaguchi-Preneel compression        for (int i = 0; i < 8; i++)        {            _hash[i] ^= _state[i] ^ _block[i];        }            }    public void update(byte in)    {        _buffer[_bufferPos] = in;        //System.out.println("adding to buffer = "+_buffer[_bufferPos]);                ++_bufferPos;                if (_bufferPos == _buffer.length)        {            processFilledBuffer(_buffer, 0);        }        increment();    }    /*     * increment() can be implemented in this way using 2 arrays or     * by having some temporary variables that are used to set the     * value provided by EIGHT[i] and carry within the loop.     *      * not having done any timing, this seems likely to be faster     * at the slight expense of 32*(sizeof short) bytes     */    private static final short[] EIGHT = new short[BITCOUNT_ARRAY_SIZE];    static     {        EIGHT[BITCOUNT_ARRAY_SIZE - 1] = 8;    }        private void increment()    {        int carry = 0;        for (int i = _bitCount.length - 1; i >= 0; i--)        {            int sum = (_bitCount[i] & 0xff) + EIGHT[i] + carry;            carry = sum >>> 8;            _bitCount[i] = (short)(sum & 0xff);        }    }            public void update(byte[] in, int inOff, int len)    {        while (len > 0)        {            update(in[inOff]);            ++inOff;            --len;        }            }        private void finish()    {        /*         * this makes a copy of the current bit length. at the expense of an         * object creation of 32 bytes rather than providing a _stopCounting         * boolean which was the alternative I could think of.         */        byte[] bitLength = copyBitLength();                 _buffer[_bufferPos++] |= 0x80;        if (_bufferPos == _buffer.length)        {            processFilledBuffer(_buffer, 0);        }        /*         * Final block contains          * [ ... data .... ][0][0][0][ length ]         *          * if [ length ] cannot fit.  Need to create a new block.         */        if (_bufferPos > 32)        {            while (_bufferPos != 0)            {                update((byte)0);            }        }                while (_bufferPos <= 32)        {            update((byte)0);        }                // copy the length information to the final 32 bytes of the        // 64 byte block....        System.arraycopy(bitLength, 0, _buffer, 32, bitLength.length);                processFilledBuffer(_buffer, 0);    }    private byte[] copyBitLength()    {        byte[] rv = new byte[BITCOUNT_ARRAY_SIZE];        for (int i = 0; i < rv.length; i++)        {            rv[i] = (byte)(_bitCount[i] & 0xff);        }        return rv;    }            public int getByteLength()    {        return BYTE_LENGTH;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色噜噜狠狠色综合欧洲selulu| 国产成人亚洲综合a∨猫咪| 色偷偷久久一区二区三区| 亚洲色欲色欲www| 色国产精品一区在线观看| 天涯成人国产亚洲精品一区av| 欧美精品xxxxbbbb| 精品亚洲porn| 综合在线观看色| 6080午夜不卡| 国产老妇另类xxxxx| 国产精品久久久久久久久晋中| 91麻豆.com| 另类综合日韩欧美亚洲| 中文字幕欧美激情| 欧美日韩免费一区二区三区| 久久国产精品露脸对白| 成人欧美一区二区三区小说| 欧美久久久久久蜜桃| 国产尤物一区二区在线| 综合av第一页| 日韩精品一区在线| 92精品国产成人观看免费 | 国产精品免费免费| 欧美色综合影院| 国产麻豆一精品一av一免费 | 日本国产一区二区| 日韩精品国产精品| 国产精品乱人伦一区二区| 在线观看91精品国产入口| 久久精品国产在热久久| 亚洲乱码国产乱码精品精的特点| 欧美一区二区福利视频| 99热这里都是精品| 国产一区二区三区在线看麻豆| 亚洲精品国产a久久久久久| 久久久综合网站| 91麻豆精品国产自产在线| 91免费国产在线| 国产一区999| 免费成人在线网站| 亚洲一二三专区| 国产精品国产精品国产专区不蜜| 欧美一区二区三区白人| 欧美在线不卡视频| 99在线视频精品| 国产一区二区三区在线观看免费视频 | 国产精品久线观看视频| 日韩午夜电影在线观看| 欧美视频一区二区三区四区| 成人听书哪个软件好| 国产麻豆视频一区二区| 奇米精品一区二区三区在线观看一| 一区二区三区四区蜜桃| 国产精品国产三级国产三级人妇 | 99久久国产综合精品麻豆 | 99精品欧美一区二区蜜桃免费| 精品在线你懂的| 日韩福利电影在线观看| 亚洲午夜一区二区三区| 一个色综合网站| 亚洲免费视频中文字幕| 国产精品美女www爽爽爽| 久久久亚洲欧洲日产国码αv| 日韩精品影音先锋| 欧美成人猛片aaaaaaa| 91精品一区二区三区久久久久久 | 亚洲视频1区2区| 欧美国产激情一区二区三区蜜月| 精品国产污网站| 精品裸体舞一区二区三区| 欧美va亚洲va国产综合| 精品福利在线导航| 久久久久免费观看| 国产精品欧美精品| 中文字幕在线不卡一区| 亚洲免费观看在线观看| 一区二区三区国产精华| 亚洲国产你懂的| 日韩不卡在线观看日韩不卡视频| 视频一区视频二区中文字幕| 亚洲成人综合在线| 蜜臀av性久久久久蜜臀aⅴ流畅| 美日韩黄色大片| 国产在线不卡视频| av在线不卡电影| 欧美色图片你懂的| 91精品欧美福利在线观看 | 欧美激情艳妇裸体舞| 国产精品国产三级国产有无不卡 | 欧美另类videos死尸| 欧美一区二区在线播放| 欧美精品一区男女天堂| 欧美激情一区在线观看| 一区二区三区四区亚洲| 日本不卡视频在线| 国产.精品.日韩.另类.中文.在线.播放 | 99久久精品免费看国产| 欧美做爰猛烈大尺度电影无法无天| 欧美日韩在线播放三区| 337p日本欧洲亚洲大胆精品| 国产欧美一区二区精品性色| 亚洲日本va午夜在线电影| 日韩和的一区二区| 国产传媒久久文化传媒| 欧美丝袜丝交足nylons| 精品日韩在线一区| 亚洲精品写真福利| 久久成人综合网| 91蜜桃在线免费视频| 欧美一区二区二区| 亚洲欧美怡红院| 久久电影国产免费久久电影| 91在线视频免费91| 日韩精品中文字幕在线一区| 亚洲人成人一区二区在线观看| 日本三级韩国三级欧美三级| 成人开心网精品视频| 91精品国产综合久久福利软件 | 在线这里只有精品| 久久综合九色综合97婷婷女人 | 亚洲成人一区在线| 成人午夜精品一区二区三区| 911精品产国品一二三产区| 国产精品大尺度| 精品综合免费视频观看| 欧美偷拍一区二区| ●精品国产综合乱码久久久久| 麻豆一区二区99久久久久| 91福利国产精品| 国产精品欧美久久久久无广告| 美女尤物国产一区| 在线观看欧美日本| 中文字幕日韩精品一区| 国产伦精一区二区三区| 91精品国产综合久久久久久漫画 | 欧美mv日韩mv| 亚洲v中文字幕| 99精品黄色片免费大全| 国产午夜精品一区二区三区嫩草| 热久久一区二区| 欧美亚洲综合久久| 日韩美女啊v在线免费观看| 国产精品夜夜爽| 欧美本精品男人aⅴ天堂| 午夜视频一区在线观看| 在线观看亚洲精品视频| 亚洲欧美日韩在线不卡| 成人午夜激情影院| 国产精品欧美久久久久一区二区| 极品少妇一区二区| 26uuu另类欧美亚洲曰本| 久久av资源网| 精品国产乱码久久久久久夜甘婷婷| 视频一区二区欧美| 91精品国产综合久久婷婷香蕉| 午夜精品久久久久久久蜜桃app| 欧美午夜免费电影| 亚洲国产成人tv| 91网上在线视频| 亚洲精品一二三四区| 色综合久久久网| 亚洲免费观看高清完整版在线观看 | 91国偷自产一区二区三区观看| 亚洲欧美日韩国产中文在线| 91一区二区三区在线观看| 18成人在线视频| 91国产丝袜在线播放| 亚洲一级二级三级在线免费观看| 欧美午夜在线观看| 日本在线不卡视频| 日韩无一区二区| 国产精品中文欧美| 中文一区在线播放| 色综合网色综合| 亚洲高清一区二区三区| 欧美精选在线播放| 精品一区二区免费看| 久久免费精品国产久精品久久久久| 国产99久久久精品| 《视频一区视频二区| 91国产免费看| 另类欧美日韩国产在线| 久久精品网站免费观看| 91婷婷韩国欧美一区二区| 亚洲h精品动漫在线观看| 日韩一级片网站| 成人中文字幕在线| 一区二区三区免费| 精品人伦一区二区色婷婷| 成人免费黄色在线| 亚洲动漫第一页| 久久色.com| 色就色 综合激情| 久久99精品一区二区三区| 国产精品第一页第二页第三页| 欧美三区在线观看| 国产成人亚洲综合a∨猫咪| 一区二区三区91| 精品国产乱码久久久久久图片|