Java Code Examples for org.spongycastle.util.Arrays#clone()

The following examples show how to use org.spongycastle.util.Arrays#clone() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProgramInvokeFactoryImpl.java    From gsc-core with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * This invocation created for contract call contract
 */
@Override
public ProgramInvoke createProgramInvoke(Program program, DataWord toAddress,
                                         DataWord callerAddress,
                                         DataWord inValue, DataWord tokenValue, DataWord tokenId, long balanceInt, byte[] dataIn,
                                         Deposit deposit, boolean isStaticCall, boolean byTestingSuite, long vmStartInUs,
                                         long vmShouldEndInUs, long cpuLimit) {

    DataWord address = toAddress;
    DataWord origin = program.getOriginAddress();
    DataWord caller = callerAddress;
    DataWord balance = new DataWord(balanceInt);
    DataWord callValue = inValue;

    byte[] data = Arrays.clone(dataIn);
    DataWord lastHash = program.getPrevHash();
    DataWord coinbase = program.getCoinbase();
    DataWord timestamp = program.getTimestamp();
    DataWord number = program.getNumber();
    DataWord difficulty = program.getDifficulty();

    return new ProgramInvokeImpl(address, origin, caller, balance, callValue, tokenValue, tokenId,
            data, lastHash, coinbase, timestamp, number, difficulty,
            deposit, program.getCallDeep() + 1, isStaticCall, byTestingSuite, vmStartInUs,
            vmShouldEndInUs, cpuLimit);
}
 
Example 2
Source File: ECPublicKey.java    From BlockchainWallet-Crypto with GNU General Public License v3.0 5 votes vote down vote up
@Override
public byte[] getRawPublicKey(boolean isCompressed) {
    if (!isCompressed) {
        throw new RuntimeException("No compressed public key");
    }
    return Arrays.clone(pub);
}
 
Example 3
Source File: ECKeyPair.java    From BlockchainWallet-Crypto with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ECKeyPair clone() throws CloneNotSupportedException {
    ECKeyPair c = (ECKeyPair) super.clone();
    c.priv = new BigInteger(c.priv.toByteArray());
    c.pub = Arrays.clone(pub);
    c.pubComp = Arrays.clone(pubComp);
    c.compressed = compressed;
    return c;
}
 
Example 4
Source File: ECKeyPair.java    From BlockchainWallet-Crypto with GNU General Public License v3.0 5 votes vote down vote up
@Override
public byte[] getRawPublicKey(boolean isCompressed) {
    if (isCompressed) {
        return Arrays.clone(pubComp);
    } else {
        return Arrays.clone(pub);
    }
}
 
Example 5
Source File: ProgramInvokeMockImpl.java    From gsc-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ProgramInvokeMockImpl(byte[] msgDataRaw) {
    this();
    this.msgData = Arrays.clone(msgDataRaw);
}
 
Example 6
Source File: ProgramInvokeMockImpl.java    From gsc-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setOwnerAddress(byte[] ownerAddress) {
    this.ownerAddress = Arrays.clone(ownerAddress);
}
 
Example 7
Source File: DataWord.java    From gsc-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
public DataWord clone() {
    return new DataWord(Arrays.clone(data));
}
 
Example 8
Source File: DataWord.java    From gsc-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
public DataWord clone() {
  return new DataWord(Arrays.clone(data));
}
 
Example 9
Source File: DataWord.java    From BlockchainWallet-Crypto with GNU General Public License v3.0 4 votes vote down vote up
public DataWord clone() {
    return new DataWord(Arrays.clone(data));
}
 
Example 10
Source File: ECPublicKey.java    From BlockchainWallet-Crypto with GNU General Public License v3.0 4 votes vote down vote up
@Override
public byte[] getRawPublicKey() {
    return Arrays.clone(pub);
}
 
Example 11
Source File: ECPublicKey.java    From BlockchainWallet-Crypto with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ECPublicKey clone() throws CloneNotSupportedException {
    ECPublicKey c = (ECPublicKey) super.clone();
    c.pub = Arrays.clone(pub);
    return c;
}
 
Example 12
Source File: ECKeyPair.java    From BlockchainWallet-Crypto with GNU General Public License v3.0 4 votes vote down vote up
protected ECKeyPair(Key keyPair) {
    this.priv = new BigInteger(1, keyPair.getRawPrivateKey());
    this.compressed = keyPair.isCompressed();
    this.pub = Arrays.clone(keyPair.getRawPublicKey(false));
    this.pubComp = Arrays.clone(keyPair.getRawPublicKey());
}
 
Example 13
Source File: ExtendedKey.java    From BlockchainWallet-Crypto with GNU General Public License v3.0 4 votes vote down vote up
public byte[] getChainCode() {
    return Arrays.clone(chainCode);
}
 
Example 14
Source File: DataWord.java    From asf-sdk with GNU General Public License v3.0 4 votes vote down vote up
public DataWord clone() {
  return new DataWord(Arrays.clone(data));
}
 
Example 15
Source File: DataWord.java    From ethereumj with MIT License 4 votes vote down vote up
public DataWord clone() {
    return new DataWord(Arrays.clone(data));
}