package com.google.crypto.tink.proto;
public final class AesCtrHmacStreamingParams extends
com.google.protobuf.GeneratedMessageV3 implements
AesCtrHmacStreamingParamsOrBuilder {
private static final long serialVersionUID = 0L;
private AesCtrHmacStreamingParams(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private AesCtrHmacStreamingParams() {
hkdfHashType_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new AesCtrHmacStreamingParams();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private AesCtrHmacStreamingParams(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
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 8: {
ciphertextSegmentSize_ = input.readUInt32();
break;
}
case 16: {
derivedKeySize_ = input.readUInt32();
break;
}
case 24: {
int rawValue = input.readEnum();
hkdfHashType_ = rawValue;
break;
}
case 34: {
com.google.crypto.tink.proto.HmacParams.Builder subBuilder = null;
if (hmacParams_ != null) {
subBuilder = hmacParams_.toBuilder();
}
hmacParams_ = input.readMessage(com.google.crypto.tink.proto.HmacParams.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(hmacParams_);
hmacParams_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
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 {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.crypto.tink.proto.AesCtrHmacStreaming.internal_static_google_crypto_tink_AesCtrHmacStreamingParams_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.crypto.tink.proto.AesCtrHmacStreaming.internal_static_google_crypto_tink_AesCtrHmacStreamingParams_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.crypto.tink.proto.AesCtrHmacStreamingParams.class, com.google.crypto.tink.proto.AesCtrHmacStreamingParams.Builder.class);
}
public static final int CIPHERTEXT_SEGMENT_SIZE_FIELD_NUMBER = 1;
private int ciphertextSegmentSize_;
public int getCiphertextSegmentSize() {
return ciphertextSegmentSize_;
}
public static final int DERIVED_KEY_SIZE_FIELD_NUMBER = 2;
private int derivedKeySize_;
public int getDerivedKeySize() {
return derivedKeySize_;
}
public static final int HKDF_HASH_TYPE_FIELD_NUMBER = 3;
private int hkdfHashType_;
public int getHkdfHashTypeValue() {
return hkdfHashType_;
}
public com.google.crypto.tink.proto.HashType getHkdfHashType() {
@SuppressWarnings("deprecation")
com.google.crypto.tink.proto.HashType result = com.google.crypto.tink.proto.HashType.valueOf(hkdfHashType_);
return result == null ? com.google.crypto.tink.proto.HashType.UNRECOGNIZED : result;
}
public static final int HMAC_PARAMS_FIELD_NUMBER = 4;
private com.google.crypto.tink.proto.HmacParams hmacParams_;
public boolean hasHmacParams() {
return hmacParams_ != null;
}
public com.google.crypto.tink.proto.HmacParams getHmacParams() {
return hmacParams_ == null ? com.google.crypto.tink.proto.HmacParams.getDefaultInstance() : hmacParams_;
}
public com.google.crypto.tink.proto.HmacParamsOrBuilder getHmacParamsOrBuilder() {
return getHmacParams();
}
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 (ciphertextSegmentSize_ != 0) {
output.writeUInt32(1, ciphertextSegmentSize_);
}
if (derivedKeySize_ != 0) {
output.writeUInt32(2, derivedKeySize_);
}
if (hkdfHashType_ != com.google.crypto.tink.proto.HashType.UNKNOWN_HASH.getNumber()) {
output.writeEnum(3, hkdfHashType_);
}
if (hmacParams_ != null) {
output.writeMessage(4, getHmacParams());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (ciphertextSegmentSize_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, ciphertextSegmentSize_);
}
if (derivedKeySize_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, derivedKeySize_);
}
if (hkdfHashType_ != com.google.crypto.tink.proto.HashType.UNKNOWN_HASH.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, hkdfHashType_);
}
if (hmacParams_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getHmacParams());
}
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 com.google.crypto.tink.proto.AesCtrHmacStreamingParams)) {
return super.equals(obj);
}
com.google.crypto.tink.proto.AesCtrHmacStreamingParams other = (com.google.crypto.tink.proto.AesCtrHmacStreamingParams) obj;
if (getCiphertextSegmentSize()
!= other.getCiphertextSegmentSize()) return false;
if (getDerivedKeySize()
!= other.getDerivedKeySize()) return false;
if (hkdfHashType_ != other.hkdfHashType_) return false;
if (hasHmacParams() != other.hasHmacParams()) return false;
if (hasHmacParams()) {
if (!getHmacParams()
.equals(other.getHmacParams())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + CIPHERTEXT_SEGMENT_SIZE_FIELD_NUMBER;
hash = (53 * hash) + getCiphertextSegmentSize();
hash = (37 * hash) + DERIVED_KEY_SIZE_FIELD_NUMBER;
hash = (53 * hash) + getDerivedKeySize();
hash = (37 * hash) + HKDF_HASH_TYPE_FIELD_NUMBER;
hash = (53 * hash) + hkdfHashType_;
if (hasHmacParams()) {
hash = (37 * hash) + HMAC_PARAMS_FIELD_NUMBER;
hash = (53 * hash) + getHmacParams().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.crypto.tink.proto.AesCtrHmacStreamingParams parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.crypto.tink.proto.AesCtrHmacStreamingParams parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.crypto.tink.proto.AesCtrHmacStreamingParams parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.crypto.tink.proto.AesCtrHmacStreamingParams parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.crypto.tink.proto.AesCtrHmacStreamingParams parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.crypto.tink.proto.AesCtrHmacStreamingParams parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.crypto.tink.proto.AesCtrHmacStreamingParams parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.crypto.tink.proto.AesCtrHmacStreamingParams 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 com.google.crypto.tink.proto.AesCtrHmacStreamingParams parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.crypto.tink.proto.AesCtrHmacStreamingParams 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 com.google.crypto.tink.proto.AesCtrHmacStreamingParams parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.crypto.tink.proto.AesCtrHmacStreamingParams 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(com.google.crypto.tink.proto.AesCtrHmacStreamingParams 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;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
com.google.crypto.tink.proto.AesCtrHmacStreamingParamsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.crypto.tink.proto.AesCtrHmacStreaming.internal_static_google_crypto_tink_AesCtrHmacStreamingParams_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.crypto.tink.proto.AesCtrHmacStreaming.internal_static_google_crypto_tink_AesCtrHmacStreamingParams_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.crypto.tink.proto.AesCtrHmacStreamingParams.class, com.google.crypto.tink.proto.AesCtrHmacStreamingParams.Builder.class);
}
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
ciphertextSegmentSize_ = 0;
derivedKeySize_ = 0;
hkdfHashType_ = 0;
if (hmacParamsBuilder_ == null) {
hmacParams_ = null;
} else {
hmacParams_ = null;
hmacParamsBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.crypto.tink.proto.AesCtrHmacStreaming.internal_static_google_crypto_tink_AesCtrHmacStreamingParams_descriptor;
}
@java.lang.Override
public com.google.crypto.tink.proto.AesCtrHmacStreamingParams getDefaultInstanceForType() {
return com.google.crypto.tink.proto.AesCtrHmacStreamingParams.getDefaultInstance();
}
@java.lang.Override
public com.google.crypto.tink.proto.AesCtrHmacStreamingParams build() {
com.google.crypto.tink.proto.AesCtrHmacStreamingParams result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.crypto.tink.proto.AesCtrHmacStreamingParams buildPartial() {
com.google.crypto.tink.proto.AesCtrHmacStreamingParams result = new com.google.crypto.tink.proto.AesCtrHmacStreamingParams(this);
result.ciphertextSegmentSize_ = ciphertextSegmentSize_;
result.derivedKeySize_ = derivedKeySize_;
result.hkdfHashType_ = hkdfHashType_;
if (hmacParamsBuilder_ == null) {
result.hmacParams_ = hmacParams_;
} else {
result.hmacParams_ = hmacParamsBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.crypto.tink.proto.AesCtrHmacStreamingParams) {
return mergeFrom((com.google.crypto.tink.proto.AesCtrHmacStreamingParams)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.crypto.tink.proto.AesCtrHmacStreamingParams other) {
if (other == com.google.crypto.tink.proto.AesCtrHmacStreamingParams.getDefaultInstance()) return this;
if (other.getCiphertextSegmentSize() != 0) {
setCiphertextSegmentSize(other.getCiphertextSegmentSize());
}
if (other.getDerivedKeySize() != 0) {
setDerivedKeySize(other.getDerivedKeySize());
}
if (other.hkdfHashType_ != 0) {
setHkdfHashTypeValue(other.getHkdfHashTypeValue());
}
if (other.hasHmacParams()) {
mergeHmacParams(other.getHmacParams());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.crypto.tink.proto.AesCtrHmacStreamingParams parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.crypto.tink.proto.AesCtrHmacStreamingParams) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int ciphertextSegmentSize_ ;
public int getCiphertextSegmentSize() {
return ciphertextSegmentSize_;
}
public Builder setCiphertextSegmentSize(int value) {
ciphertextSegmentSize_ = value;
onChanged();
return this;
}
public Builder clearCiphertextSegmentSize() {
ciphertextSegmentSize_ = 0;
onChanged();
return this;
}
private int derivedKeySize_ ;
public int getDerivedKeySize() {
return derivedKeySize_;
}
public Builder setDerivedKeySize(int value) {
derivedKeySize_ = value;
onChanged();
return this;
}
public Builder clearDerivedKeySize() {
derivedKeySize_ = 0;
onChanged();
return this;
}
private int hkdfHashType_ = 0;
public int getHkdfHashTypeValue() {
return hkdfHashType_;
}
public Builder setHkdfHashTypeValue(int value) {
hkdfHashType_ = value;
onChanged();
return this;
}
public com.google.crypto.tink.proto.HashType getHkdfHashType() {
@SuppressWarnings("deprecation")
com.google.crypto.tink.proto.HashType result = com.google.crypto.tink.proto.HashType.valueOf(hkdfHashType_);
return result == null ? com.google.crypto.tink.proto.HashType.UNRECOGNIZED : result;
}
public Builder setHkdfHashType(com.google.crypto.tink.proto.HashType value) {
if (value == null) {
throw new NullPointerException();
}
hkdfHashType_ = value.getNumber();
onChanged();
return this;
}
public Builder clearHkdfHashType() {
hkdfHashType_ = 0;
onChanged();
return this;
}
private com.google.crypto.tink.proto.HmacParams hmacParams_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.crypto.tink.proto.HmacParams, com.google.crypto.tink.proto.HmacParams.Builder, com.google.crypto.tink.proto.HmacParamsOrBuilder> hmacParamsBuilder_;
public boolean hasHmacParams() {
return hmacParamsBuilder_ != null || hmacParams_ != null;
}
public com.google.crypto.tink.proto.HmacParams getHmacParams() {
if (hmacParamsBuilder_ == null) {
return hmacParams_ == null ? com.google.crypto.tink.proto.HmacParams.getDefaultInstance() : hmacParams_;
} else {
return hmacParamsBuilder_.getMessage();
}
}
public Builder setHmacParams(com.google.crypto.tink.proto.HmacParams value) {
if (hmacParamsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
hmacParams_ = value;
onChanged();
} else {
hmacParamsBuilder_.setMessage(value);
}
return this;
}
public Builder setHmacParams(
com.google.crypto.tink.proto.HmacParams.Builder builderForValue) {
if (hmacParamsBuilder_ == null) {
hmacParams_ = builderForValue.build();
onChanged();
} else {
hmacParamsBuilder_.setMessage(builderForValue.build());
}
return this;
}
public Builder mergeHmacParams(com.google.crypto.tink.proto.HmacParams value) {
if (hmacParamsBuilder_ == null) {
if (hmacParams_ != null) {
hmacParams_ =
com.google.crypto.tink.proto.HmacParams.newBuilder(hmacParams_).mergeFrom(value).buildPartial();
} else {
hmacParams_ = value;
}
onChanged();
} else {
hmacParamsBuilder_.mergeFrom(value);
}
return this;
}
public Builder clearHmacParams() {
if (hmacParamsBuilder_ == null) {
hmacParams_ = null;
onChanged();
} else {
hmacParams_ = null;
hmacParamsBuilder_ = null;
}
return this;
}
public com.google.crypto.tink.proto.HmacParams.Builder getHmacParamsBuilder() {
onChanged();
return getHmacParamsFieldBuilder().getBuilder();
}
public com.google.crypto.tink.proto.HmacParamsOrBuilder getHmacParamsOrBuilder() {
if (hmacParamsBuilder_ != null) {
return hmacParamsBuilder_.getMessageOrBuilder();
} else {
return hmacParams_ == null ?
com.google.crypto.tink.proto.HmacParams.getDefaultInstance() : hmacParams_;
}
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.crypto.tink.proto.HmacParams, com.google.crypto.tink.proto.HmacParams.Builder, com.google.crypto.tink.proto.HmacParamsOrBuilder>
getHmacParamsFieldBuilder() {
if (hmacParamsBuilder_ == null) {
hmacParamsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.crypto.tink.proto.HmacParams, com.google.crypto.tink.proto.HmacParams.Builder, com.google.crypto.tink.proto.HmacParamsOrBuilder>(
getHmacParams(),
getParentForChildren(),
isClean());
hmacParams_ = null;
}
return hmacParamsBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
}
private static final com.google.crypto.tink.proto.AesCtrHmacStreamingParams DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.crypto.tink.proto.AesCtrHmacStreamingParams();
}
public static com.google.crypto.tink.proto.AesCtrHmacStreamingParams getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<AesCtrHmacStreamingParams>
PARSER = new com.google.protobuf.AbstractParser<AesCtrHmacStreamingParams>() {
@java.lang.Override
public AesCtrHmacStreamingParams parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new AesCtrHmacStreamingParams(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<AesCtrHmacStreamingParams> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<AesCtrHmacStreamingParams> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.crypto.tink.proto.AesCtrHmacStreamingParams getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}