@@ -454,10 +454,31 @@ { return [[OFSecureData alloc] initWithItems: _items itemSize: _itemSize count: _count]; } + +- (bool)isEqual: (id)object +{ + OFData *otherData; + unsigned char diff; + + if (![object isKindOfClass: [OFData class]]) + return false; + + otherData = object; + + if (otherData->_count != _count || otherData->_itemSize != _itemSize) + return false; + + diff = 0; + + for (size_t i = 0; i < _count * _itemSize; i++) + diff |= otherData->_items[i] ^ _items[i]; + + return (diff == 0); +} - (OFString *)description { return @""; }