bitField0_ = (bitField0_ & ~0x00000010); if (encryptionParametersBuilder_ == null) { encryptionParameters_ = com.openwallet.core.protos.Protos.ScryptParameters.getDefaultInstance(); } else { encryptionParametersBuilder_.clear();
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, salt_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeInt64(2, n_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeInt32(3, r_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeInt32(4, p_); } getUnknownFields().writeTo(output); }
public com.openwallet.core.protos.Protos.ScryptParameters buildPartial() { com.openwallet.core.protos.Protos.ScryptParameters result = new com.openwallet.core.protos.Protos.ScryptParameters(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.salt_ = salt_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.n_ = n_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.r_ = r_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } result.p_ = p_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
private static KeyCrypter getKeyCrypter(Protos.Wallet walletProto) { KeyCrypter crypter; if (walletProto.hasEncryptionType()) { if (walletProto.getEncryptionType() == Protos.Wallet.EncryptionType.ENCRYPTED_SCRYPT_AES) { checkState(walletProto.hasEncryptionParameters(), "Encryption parameters are missing"); Protos.ScryptParameters encryptionParameters = walletProto.getEncryptionParameters(); org.bitcoinj.wallet.Protos.ScryptParameters.Builder bitcoinjCrypter = org.bitcoinj.wallet.Protos.ScryptParameters.newBuilder(); bitcoinjCrypter.setSalt(encryptionParameters.getSalt()); bitcoinjCrypter.setN(encryptionParameters.getN()); bitcoinjCrypter.setP(encryptionParameters.getP()); bitcoinjCrypter.setR(encryptionParameters.getR()); crypter = new KeyCrypterScrypt(bitcoinjCrypter.build()); } else if (walletProto.getEncryptionType() == Protos.Wallet.EncryptionType.UNENCRYPTED) { crypter = null; } else { throw new KeyCrypterException("Unsupported encryption: " + walletProto.getEncryptionType().toString()); } } else { crypter = null; } return crypter; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, salt_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(2, n_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(3, r_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(4, p_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
/** * <code>optional .com.openwallet.core.protos.ScryptParameters encryption_parameters = 5;</code> */ public Builder mergeEncryptionParameters(com.openwallet.core.protos.Protos.ScryptParameters value) { if (encryptionParametersBuilder_ == null) { if (((bitField0_ & 0x00000020) == 0x00000020) && encryptionParameters_ != com.openwallet.core.protos.Protos.ScryptParameters.getDefaultInstance()) { encryptionParameters_ = com.openwallet.core.protos.Protos.ScryptParameters.newBuilder(encryptionParameters_).mergeFrom(value).buildPartial(); } else { encryptionParameters_ = value; } onChanged(); } else { encryptionParametersBuilder_.mergeFrom(value); } bitField0_ |= 0x00000020; return this; } /**
public Builder mergeFrom(com.openwallet.core.protos.Protos.ScryptParameters other) { if (other == com.openwallet.core.protos.Protos.ScryptParameters.getDefaultInstance()) return this; if (other.hasSalt()) { setSalt(other.getSalt()); } if (other.hasN()) { setN(other.getN()); } if (other.hasR()) { setR(other.getR()); } if (other.hasP()) { setP(other.getP()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public com.openwallet.core.protos.Protos.ScryptParameters getDefaultInstanceForType() { return com.openwallet.core.protos.Protos.ScryptParameters.getDefaultInstance(); }
/** * <code>required bytes salt = 1;</code> * * <pre> * Salt to use in generation of the wallet password (8 bytes) * </pre> */ public Builder clearSalt() { bitField0_ = (bitField0_ & ~0x00000001); salt_ = getDefaultInstance().getSalt(); onChanged(); return this; }
/** * <code>optional .com.openwallet.core.protos.ScryptParameters encryption_parameters = 5;</code> */ public Builder clearEncryptionParameters() { if (encryptionParametersBuilder_ == null) { encryptionParameters_ = com.openwallet.core.protos.Protos.ScryptParameters.getDefaultInstance(); onChanged(); } else { encryptionParametersBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000020); return this; } /**
private void initFields() { version_ = 1; seed_ = com.openwallet.core.protos.Protos.Key.getDefaultInstance(); seedPasswordProtected_ = false; masterKey_ = com.openwallet.core.protos.Protos.Key.getDefaultInstance(); encryptionType_ = com.openwallet.core.protos.Protos.Wallet.EncryptionType.UNENCRYPTED; encryptionParameters_ = com.openwallet.core.protos.Protos.ScryptParameters.getDefaultInstance(); pockets_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1;