Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: confio/proofs.proto
package tech.confio.ics23;
/**
*
**
*ExistenceProof takes a key and a value and a set of steps to perform on it.
*The result of peforming all these steps will provide a "root hash", which can
*be compared to the value in a header.
*Since it is computationally infeasible to produce a hash collission for any of the used
*cryptographic hash functions, if someone can provide a series of operations to transform
*a given key and value into a root hash that matches some trusted root, these key and values
*must be in the referenced merkle tree.
*The only possible issue is maliablity in LeafOp, such as providing extra prefix data,
*which should be controlled by a spec. Eg. with lengthOp as NONE,
*prefix = FOO, key = BAR, value = CHOICE
*and
*prefix = F, key = OOBAR, value = CHOICE
*would produce the same value.
*With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field
*in the ProofSpec is valuable to prevent this mutability. And why all trees should
*length-prefix the data before hashing it.
*
*
* Protobuf type {@code ics23.ExistenceProof}
*/
public final class ExistenceProof extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:ics23.ExistenceProof)
ExistenceProofOrBuilder {
private static final long serialVersionUID = 0L;
// Use ExistenceProof.newBuilder() to construct.
private ExistenceProof(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private ExistenceProof() {
key_ = com.google.protobuf.ByteString.EMPTY;
value_ = com.google.protobuf.ByteString.EMPTY;
path_ = java.util.Collections.emptyList();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ExistenceProof(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
key_ = input.readBytes();
break;
}
case 18: {
value_ = input.readBytes();
break;
}
case 26: {
tech.confio.ics23.LeafOp.Builder subBuilder = null;
if (leaf_ != null) {
subBuilder = leaf_.toBuilder();
}
leaf_ = input.readMessage(tech.confio.ics23.LeafOp.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(leaf_);
leaf_ = subBuilder.buildPartial();
}
break;
}
case 34: {
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
path_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000008;
}
path_.add(
input.readMessage(tech.confio.ics23.InnerOp.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
path_ = java.util.Collections.unmodifiableList(path_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tech.confio.ics23.Proofs.internal_static_ics23_ExistenceProof_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tech.confio.ics23.Proofs.internal_static_ics23_ExistenceProof_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tech.confio.ics23.ExistenceProof.class, tech.confio.ics23.ExistenceProof.Builder.class);
}
private int bitField0_;
public static final int KEY_FIELD_NUMBER = 1;
private com.google.protobuf.ByteString key_;
/**
* bytes key = 1;
*/
public com.google.protobuf.ByteString getKey() {
return key_;
}
public static final int VALUE_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString value_;
/**
* bytes value = 2;
*/
public com.google.protobuf.ByteString getValue() {
return value_;
}
public static final int LEAF_FIELD_NUMBER = 3;
private tech.confio.ics23.LeafOp leaf_;
/**
* .ics23.LeafOp leaf = 3;
*/
public boolean hasLeaf() {
return leaf_ != null;
}
/**
* .ics23.LeafOp leaf = 3;
*/
public tech.confio.ics23.LeafOp getLeaf() {
return leaf_ == null ? tech.confio.ics23.LeafOp.getDefaultInstance() : leaf_;
}
/**
* .ics23.LeafOp leaf = 3;
*/
public tech.confio.ics23.LeafOpOrBuilder getLeafOrBuilder() {
return getLeaf();
}
public static final int PATH_FIELD_NUMBER = 4;
private java.util.List path_;
/**
* repeated .ics23.InnerOp path = 4;
*/
public java.util.List getPathList() {
return path_;
}
/**
* repeated .ics23.InnerOp path = 4;
*/
public java.util.List extends tech.confio.ics23.InnerOpOrBuilder>
getPathOrBuilderList() {
return path_;
}
/**
* repeated .ics23.InnerOp path = 4;
*/
public int getPathCount() {
return path_.size();
}
/**
* repeated .ics23.InnerOp path = 4;
*/
public tech.confio.ics23.InnerOp getPath(int index) {
return path_.get(index);
}
/**
* repeated .ics23.InnerOp path = 4;
*/
public tech.confio.ics23.InnerOpOrBuilder getPathOrBuilder(
int index) {
return path_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!key_.isEmpty()) {
output.writeBytes(1, key_);
}
if (!value_.isEmpty()) {
output.writeBytes(2, value_);
}
if (leaf_ != null) {
output.writeMessage(3, getLeaf());
}
for (int i = 0; i < path_.size(); i++) {
output.writeMessage(4, path_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!key_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, key_);
}
if (!value_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, value_);
}
if (leaf_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, getLeaf());
}
for (int i = 0; i < path_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, path_.get(i));
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tech.confio.ics23.ExistenceProof)) {
return super.equals(obj);
}
tech.confio.ics23.ExistenceProof other = (tech.confio.ics23.ExistenceProof) obj;
boolean result = true;
result = result && getKey()
.equals(other.getKey());
result = result && getValue()
.equals(other.getValue());
result = result && (hasLeaf() == other.hasLeaf());
if (hasLeaf()) {
result = result && getLeaf()
.equals(other.getLeaf());
}
result = result && getPathList()
.equals(other.getPathList());
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + KEY_FIELD_NUMBER;
hash = (53 * hash) + getKey().hashCode();
hash = (37 * hash) + VALUE_FIELD_NUMBER;
hash = (53 * hash) + getValue().hashCode();
if (hasLeaf()) {
hash = (37 * hash) + LEAF_FIELD_NUMBER;
hash = (53 * hash) + getLeaf().hashCode();
}
if (getPathCount() > 0) {
hash = (37 * hash) + PATH_FIELD_NUMBER;
hash = (53 * hash) + getPathList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static tech.confio.ics23.ExistenceProof parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.confio.ics23.ExistenceProof parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.confio.ics23.ExistenceProof parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.confio.ics23.ExistenceProof parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.confio.ics23.ExistenceProof parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tech.confio.ics23.ExistenceProof parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tech.confio.ics23.ExistenceProof parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.confio.ics23.ExistenceProof parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tech.confio.ics23.ExistenceProof parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tech.confio.ics23.ExistenceProof parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tech.confio.ics23.ExistenceProof parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tech.confio.ics23.ExistenceProof parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tech.confio.ics23.ExistenceProof prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
**
*ExistenceProof takes a key and a value and a set of steps to perform on it.
*The result of peforming all these steps will provide a "root hash", which can
*be compared to the value in a header.
*Since it is computationally infeasible to produce a hash collission for any of the used
*cryptographic hash functions, if someone can provide a series of operations to transform
*a given key and value into a root hash that matches some trusted root, these key and values
*must be in the referenced merkle tree.
*The only possible issue is maliablity in LeafOp, such as providing extra prefix data,
*which should be controlled by a spec. Eg. with lengthOp as NONE,
*prefix = FOO, key = BAR, value = CHOICE
*and
*prefix = F, key = OOBAR, value = CHOICE
*would produce the same value.
*With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field
*in the ProofSpec is valuable to prevent this mutability. And why all trees should
*length-prefix the data before hashing it.
*