Example usage for org.bouncycastle.util Arrays clone

List of usage examples for org.bouncycastle.util Arrays clone

Introduction

In this page you can find the example usage for org.bouncycastle.util Arrays clone.

Prototype

public static byte[][][] clone(byte[][][] data) 

Source Link

Usage

From source file:ch.ge.ve.protopoc.service.model.ObliviousTransferResponse.java

License:Open Source License

public byte[][] getC() {
    return Arrays.clone(c);
}

From source file:co.rsk.core.bc.BlockChainImplTest.java

License:Open Source License

private static byte[] cloneAlterBytes(byte[] bytes) {
    byte[] cloned = Arrays.clone(bytes);

    if (cloned == null)
        return new byte[] { 0x01 };

    alterBytes(cloned);//from  w w w.j  a v a2 s  . co  m
    return cloned;
}

From source file:com.all.dht.database.OversizedStorable.java

License:Apache License

public OversizedStorable(KUID primaryKey, byte[] oversizedValue) {
    super(primaryKey,
            new DHTValueImpl(DhtSettings.ALL_TYPE, Version.ZERO,
                    JsonConverter.toJson(new OversizedValueInfo(primaryKey.toHexString(),
                            Digest.getSha1(oversizedValue), new Date().getTime())).getBytes()));
    this.oversizedValue = Arrays.clone(oversizedValue);
}

From source file:com.all.dht.database.OversizedValueInfo.java

License:Apache License

public OversizedValueInfo(String primaryKey, byte[] sha1, long storedOn) {
    this.primaryKey = primaryKey;
    this.sha1 = Arrays.clone(sha1);
    this.storedOn = storedOn;
}

From source file:com.all.dht.database.OversizedValueInfo.java

License:Apache License

public void setSha1(byte[] sha1) {
    this.sha1 = Arrays.clone(sha1);
}

From source file:com.bitsofproof.supernode.api.Address.java

License:Apache License

/**
 * Create an address/*from www.j  a  v a 2  s.  c om*/
 * 
 * @param network
 *            - Network PRODUCTION or TEST
 * @param type
 *            - COMMON or P2SH
 * @param address
 *            - digest of key (COMMON) or script (P2SH)
 * @throws ValidationException
 *             - thrown if digest length is not 20 bytes
 */
public Address(Network network, Type type, byte[] address) throws ValidationException {
    this.network = network;
    this.type = type;
    if (address.length != 20) {
        throw new ValidationException("invalid digest length for an address");
    }
    this.bytes = Arrays.clone(address);
}

From source file:com.bitsofproof.supernode.api.Address.java

License:Apache License

/**
 * Create an address//from  ww w  . j ava  2s .c  o  m
 * 
 * @param type
 *            - COMMON or P2SH
 * @param address
 *            - digest of key (COMMON) or script (P2SH)
 * @throws ValidationException
 *             - thrown if digest length is not 20 bytes
 */
public Address(Type type, byte[] address) throws ValidationException {
    this.type = type;
    if (address.length != 20) {
        throw new ValidationException("invalid digest length for an address");
    }
    this.bytes = Arrays.clone(address);
}

From source file:com.bitsofproof.supernode.api.Address.java

License:Apache License

/**
 * Create an address/*from w w w.  j  a  v  a2s.  co m*/
 * 
 * @param network
 *            - Network PRODUCTION or TEST
 * @param address
 *            - an other address
 */
public Address(Network network, Address address) throws ValidationException {
    this.network = network;
    this.type = address.type;
    this.bytes = Arrays.clone(address.bytes);
}

From source file:com.bitsofproof.supernode.api.Address.java

License:Apache License

/**
 * get the address digest
 * 
 * @return digest
 */
public byte[] toByteArray() {
    return Arrays.clone(bytes);
}

From source file:com.bitsofproof.supernode.api.BloomFilter.java

License:Apache License

public BloomFilter(byte[] data, long hashFunctions, long tweak, UpdateMode update) {
    filter = Arrays.clone(data);
    this.hashFunctions = Math.min(hashFunctions, MAX_HASH_FUNCS);
    this.tweak = tweak;
    this.update = update;
}