当前位置: 首页>>代码示例>>Java>>正文


Java Pack.intToBigEndian方法代码示例

本文整理汇总了Java中org.bouncycastle.crypto.util.Pack.intToBigEndian方法的典型用法代码示例。如果您正苦于以下问题:Java Pack.intToBigEndian方法的具体用法?Java Pack.intToBigEndian怎么用?Java Pack.intToBigEndian使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.crypto.util.Pack的用法示例。


在下文中一共展示了Pack.intToBigEndian方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doFinal

import org.bouncycastle.crypto.util.Pack; //导入方法依赖的package包/类
public int doFinal(
    byte[]  out,
    int     outOff)
{
    finish();

    Pack.intToBigEndian(H1, out, outOff);
    Pack.intToBigEndian(H2, out, outOff + 4);
    Pack.intToBigEndian(H3, out, outOff + 8);
    Pack.intToBigEndian(H4, out, outOff + 12);
    Pack.intToBigEndian(H5, out, outOff + 16);
    Pack.intToBigEndian(H6, out, outOff + 20);
    Pack.intToBigEndian(H7, out, outOff + 24);
    Pack.intToBigEndian(H8, out, outOff + 28);

    reset();

    return DIGEST_LENGTH;
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:20,代码来源:SHA256Digest.java

示例2: doFinal

import org.bouncycastle.crypto.util.Pack; //导入方法依赖的package包/类
public int doFinal(
    byte[]  out,
    int     outOff)
{
    finish();

    Pack.intToBigEndian(H1, out, outOff);
    Pack.intToBigEndian(H2, out, outOff + 4);
    Pack.intToBigEndian(H3, out, outOff + 8);
    Pack.intToBigEndian(H4, out, outOff + 12);
    Pack.intToBigEndian(H5, out, outOff + 16);

    reset();

    return DIGEST_LENGTH;
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:17,代码来源:SHA1Digest.java

示例3: doFinal

import org.bouncycastle.crypto.util.Pack; //导入方法依赖的package包/类
public int doFinal(
    byte[]  out,
    int     outOff)
{
    finish();

    Pack.intToBigEndian(H1, out, outOff);
    Pack.intToBigEndian(H2, out, outOff + 4);
    Pack.intToBigEndian(H3, out, outOff + 8);
    Pack.intToBigEndian(H4, out, outOff + 12);
    Pack.intToBigEndian(H5, out, outOff + 16);
    Pack.intToBigEndian(H6, out, outOff + 20);
    Pack.intToBigEndian(H7, out, outOff + 24);

    reset();

    return DIGEST_LENGTH;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:19,代码来源:SHA224Digest.java

示例4: multiplyH

import org.bouncycastle.crypto.util.Pack; //导入方法依赖的package包/类
public void multiplyH(byte[] x)
    {
//      assert x.Length == 16;

        int[] z = new int[4];
        for (int i = 15; i >= 0; --i)
        {
//            GCMUtil.xor(z, M[i][x[i] & 0xff]);
            int[] m = M[i][x[i] & 0xff];
            z[0] ^= m[0];
            z[1] ^= m[1];
            z[2] ^= m[2];
            z[3] ^= m[3];
        }

        Pack.intToBigEndian(z, x, 0);
    }
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:Tables64kGCMMultiplier.java

示例5: multiplyH

import org.bouncycastle.crypto.util.Pack; //导入方法依赖的package包/类
public void multiplyH(byte[] x)
    {
//      assert x.Length == 16;

        int[] z = new int[4];
        for (int i = 15; i >= 0; --i)
        {
//            GCMUtil.xor(z, M[i + i][x[i] & 0x0f]);
            int[] m = M[i + i][x[i] & 0x0f];
            z[0] ^= m[0];
            z[1] ^= m[1];
            z[2] ^= m[2];
            z[3] ^= m[3];
//            GCMUtil.xor(z, M[i + i + 1][(x[i] & 0xf0) >>> 4]);
            m = M[i + i + 1][(x[i] & 0xf0) >>> 4];
            z[0] ^= m[0];
            z[1] ^= m[1];
            z[2] ^= m[2];
            z[3] ^= m[3];
        }

        Pack.intToBigEndian(z, x, 0);
    }
 
开发者ID:Appdome,项目名称:ipack,代码行数:24,代码来源:Tables8kGCMMultiplier.java

示例6: doFinal

import org.bouncycastle.crypto.util.Pack; //导入方法依赖的package包/类
public int doFinal(byte[] out,
                   int outOff)
{
    finish();

    Pack.intToBigEndian(this.V[0], out, outOff + 0);
    Pack.intToBigEndian(this.V[1], out, outOff + 4);
    Pack.intToBigEndian(this.V[2], out, outOff + 8);
    Pack.intToBigEndian(this.V[3], out, outOff + 12);
    Pack.intToBigEndian(this.V[4], out, outOff + 16);
    Pack.intToBigEndian(this.V[5], out, outOff + 20);
    Pack.intToBigEndian(this.V[6], out, outOff + 24);
    Pack.intToBigEndian(this.V[7], out, outOff + 28);

    reset();

    return DIGEST_LENGTH;
}
 
开发者ID:NoYouShutup,项目名称:CryptMeme,代码行数:19,代码来源:SM3Digest.java

示例7: returnByte

import org.bouncycastle.crypto.util.Pack; //导入方法依赖的package包/类
public byte returnByte(byte in)
{
    if (index == 0) 
    {
        isaac();
        keyStream = Pack.intToBigEndian(results);
    }
    byte out = (byte)(keyStream[index]^in);
    index = (index + 1) & 1023;
    
    return out;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:13,代码来源:ISAACEngine.java

示例8: processBytes

import org.bouncycastle.crypto.util.Pack; //导入方法依赖的package包/类
public void processBytes(
    byte[]  in, 
    int     inOff, 
    int     len, 
    byte[]  out, 
    int     outOff)
{
    if (!initialised)
    {
        throw new IllegalStateException(getAlgorithmName()+" not initialised");
    }
    
    if ((inOff + len) > in.length)
    {
        throw new DataLengthException("input buffer too short");
    }
    
    if ((outOff + len) > out.length)
    {
        throw new OutputLengthException("output buffer too short");
    }
    
    for (int i = 0; i < len; i++)
    {
        if (index == 0) 
        {
            isaac();
            keyStream = Pack.intToBigEndian(results);
        }
        out[i+outOff] = (byte)(keyStream[index]^in[i+inOff]);
        index = (index + 1) & 1023;
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:34,代码来源:ISAACEngine.java

示例9: asBytes

import org.bouncycastle.crypto.util.Pack; //导入方法依赖的package包/类
static byte[] asBytes(int[] ns)
{
    byte[] output = new byte[16];
    Pack.intToBigEndian(ns, output, 0);
    return output;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:7,代码来源:GCMUtil.java

示例10: generateBytes

import org.bouncycastle.crypto.util.Pack; //导入方法依赖的package包/类
/**
 * fill len bytes of the output buffer with bytes generated from the
 * derivation function.
 * 
 * @throws IllegalArgumentException
 *             if the size of the request will cause an overflow.
 * @throws DataLengthException
 *             if the out buffer is too small.
 */
public int generateBytes(byte[] out, int outOff, int len) throws DataLengthException,
        IllegalArgumentException
{
    if ((out.length - len) < outOff)
    {
        throw new DataLengthException("output buffer too small");
    }

    long oBytes = len;
    int outLen = digest.getDigestSize();

    //
    // this is at odds with the standard implementation, the
    // maximum value should be hBits * (2^32 - 1) where hBits
    // is the digest output size in bits. We can't have an
    // array with a long index at the moment...
    //
    if (oBytes > ((2L << 32) - 1))
    {
        throw new IllegalArgumentException("Output length too large");
    }

    int cThreshold = (int)((oBytes + outLen - 1) / outLen);

    byte[] dig = new byte[digest.getDigestSize()];

    byte[] C = new byte[4];
    Pack.intToBigEndian(counterStart, C, 0);

    int counterBase = counterStart & ~0xFF;

    for (int i = 0; i < cThreshold; i++)
    {
        digest.update(shared, 0, shared.length);
        digest.update(C, 0, C.length);

        if (iv != null)
        {
            digest.update(iv, 0, iv.length);
        }

        digest.doFinal(dig, 0);

        if (len > outLen)
        {
            System.arraycopy(dig, 0, out, outOff, outLen);
            outOff += outLen;
            len -= outLen;
        }
        else
        {
            System.arraycopy(dig, 0, out, outOff, len);
        }

        if (++C[3] == 0)
        {
            counterBase += 0x100;
            Pack.intToBigEndian(counterBase, C, 0);
        }
    }

    digest.reset();

    return (int)oBytes;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:75,代码来源:BaseKDFBytesGenerator.java

示例11: asBytes

import org.bouncycastle.crypto.util.Pack; //导入方法依赖的package包/类
static byte[] asBytes(int[] x)
{
    byte[] z = new byte[16];
    Pack.intToBigEndian(x, z, 0);
    return z;
}
 
开发者ID:NoYouShutup,项目名称:CryptMeme,代码行数:7,代码来源:GCMUtil.java


注:本文中的org.bouncycastle.crypto.util.Pack.intToBigEndian方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。