]> git.saurik.com Git - apple/security.git/blobdiff - keychain/TrustedPeersHelper/proto/generated_source/OTAuthenticatedCiphertext.m
Security-59306.11.20.tar.gz
[apple/security.git] / keychain / TrustedPeersHelper / proto / generated_source / OTAuthenticatedCiphertext.m
diff --git a/keychain/TrustedPeersHelper/proto/generated_source/OTAuthenticatedCiphertext.m b/keychain/TrustedPeersHelper/proto/generated_source/OTAuthenticatedCiphertext.m
new file mode 100644 (file)
index 0000000..050bcc1
--- /dev/null
@@ -0,0 +1,167 @@
+// This file was automatically generated by protocompiler
+// DO NOT EDIT!
+// Compiled from OTAuthenticatedCiphertext.proto
+
+#import "OTAuthenticatedCiphertext.h"
+#import <ProtocolBuffer/PBConstants.h>
+#import <ProtocolBuffer/PBHashUtil.h>
+#import <ProtocolBuffer/PBDataReader.h>
+
+#if !__has_feature(objc_arc)
+# error This generated file depends on ARC but it is not enabled; turn on ARC, or use 'objc_use_arc' option to generate non-ARC code.
+#endif
+
+@implementation OTAuthenticatedCiphertext
+
+@synthesize ciphertext = _ciphertext;
+@synthesize authenticationCode = _authenticationCode;
+@synthesize initializationVector = _initializationVector;
+
+- (NSString *)description
+{
+    return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
+}
+
+- (NSDictionary *)dictionaryRepresentation
+{
+    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
+    if (self->_ciphertext)
+    {
+        [dict setObject:self->_ciphertext forKey:@"ciphertext"];
+    }
+    if (self->_authenticationCode)
+    {
+        [dict setObject:self->_authenticationCode forKey:@"authenticationCode"];
+    }
+    if (self->_initializationVector)
+    {
+        [dict setObject:self->_initializationVector forKey:@"initializationVector"];
+    }
+    return dict;
+}
+
+BOOL OTAuthenticatedCiphertextReadFrom(__unsafe_unretained OTAuthenticatedCiphertext *self, __unsafe_unretained PBDataReader *reader) {
+    while (PBReaderHasMoreData(reader)) {
+        uint32_t tag = 0;
+        uint8_t aType = 0;
+
+        PBReaderReadTag32AndType(reader, &tag, &aType);
+
+        if (PBReaderHasError(reader))
+            break;
+
+        if (aType == TYPE_END_GROUP) {
+            break;
+        }
+
+        switch (tag) {
+
+            case 1 /* ciphertext */:
+            {
+                NSData *new_ciphertext = PBReaderReadData(reader);
+                self->_ciphertext = new_ciphertext;
+            }
+            break;
+            case 2 /* authenticationCode */:
+            {
+                NSData *new_authenticationCode = PBReaderReadData(reader);
+                self->_authenticationCode = new_authenticationCode;
+            }
+            break;
+            case 3 /* initializationVector */:
+            {
+                NSData *new_initializationVector = PBReaderReadData(reader);
+                self->_initializationVector = new_initializationVector;
+            }
+            break;
+            default:
+                if (!PBReaderSkipValueWithTag(reader, tag, aType))
+                    return NO;
+                break;
+        }
+    }
+    return !PBReaderHasError(reader);
+}
+
+- (BOOL)readFrom:(PBDataReader *)reader
+{
+    return OTAuthenticatedCiphertextReadFrom(self, reader);
+}
+- (void)writeTo:(PBDataWriter *)writer
+{
+    /* ciphertext */
+    {
+        assert(nil != self->_ciphertext);
+        PBDataWriterWriteDataField(writer, self->_ciphertext, 1);
+    }
+    /* authenticationCode */
+    {
+        assert(nil != self->_authenticationCode);
+        PBDataWriterWriteDataField(writer, self->_authenticationCode, 2);
+    }
+    /* initializationVector */
+    {
+        assert(nil != self->_initializationVector);
+        PBDataWriterWriteDataField(writer, self->_initializationVector, 3);
+    }
+}
+
+- (void)copyTo:(OTAuthenticatedCiphertext *)other
+{
+    other.ciphertext = _ciphertext;
+    other.authenticationCode = _authenticationCode;
+    other.initializationVector = _initializationVector;
+}
+
+- (id)copyWithZone:(NSZone *)zone
+{
+    OTAuthenticatedCiphertext *copy = [[[self class] allocWithZone:zone] init];
+    copy->_ciphertext = [_ciphertext copyWithZone:zone];
+    copy->_authenticationCode = [_authenticationCode copyWithZone:zone];
+    copy->_initializationVector = [_initializationVector copyWithZone:zone];
+    return copy;
+}
+
+- (BOOL)isEqual:(id)object
+{
+    OTAuthenticatedCiphertext *other = (OTAuthenticatedCiphertext *)object;
+    return [other isMemberOfClass:[self class]]
+    &&
+    ((!self->_ciphertext && !other->_ciphertext) || [self->_ciphertext isEqual:other->_ciphertext])
+    &&
+    ((!self->_authenticationCode && !other->_authenticationCode) || [self->_authenticationCode isEqual:other->_authenticationCode])
+    &&
+    ((!self->_initializationVector && !other->_initializationVector) || [self->_initializationVector isEqual:other->_initializationVector])
+    ;
+}
+
+- (NSUInteger)hash
+{
+    return 0
+    ^
+    [self->_ciphertext hash]
+    ^
+    [self->_authenticationCode hash]
+    ^
+    [self->_initializationVector hash]
+    ;
+}
+
+- (void)mergeFrom:(OTAuthenticatedCiphertext *)other
+{
+    if (other->_ciphertext)
+    {
+        [self setCiphertext:other->_ciphertext];
+    }
+    if (other->_authenticationCode)
+    {
+        [self setAuthenticationCode:other->_authenticationCode];
+    }
+    if (other->_initializationVector)
+    {
+        [self setInitializationVector:other->_initializationVector];
+    }
+}
+
+@end
+