void MFNHashFileSaltedProtobuf_SaltedHash::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // optional bytes hash = 1;
  if (has_hash()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      1, this->hash(), output);
  }
  
  // optional bytes salt = 2;
  if (has_salt()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      2, this->salt(), output);
  }
  
  // optional uint32 iteration_count = 3;
  if (has_iteration_count()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->iteration_count(), output);
  }
  
  // optional bytes other_data_1 = 4;
  if (has_other_data_1()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      4, this->other_data_1(), output);
  }
  
  // optional bytes other_data_2 = 5;
  if (has_other_data_2()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      5, this->other_data_2(), output);
  }
  
  // optional bytes other_data_3 = 6;
  if (has_other_data_3()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      6, this->other_data_3(), output);
  }
  
  // optional bytes other_data_4 = 7;
  if (has_other_data_4()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      7, this->other_data_4(), output);
  }
  
  // optional bytes other_data_5 = 8;
  if (has_other_data_5()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      8, this->other_data_5(), output);
  }
  
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
}
Esempio n. 2
0
void JavaNear::print_value_on(Stream* st) {
  if (is_locked()) {
    st->print("locked ");
  }
  st->print("JavaNear");
  if (has_hash()) {
    st->print(" [hash = %d]", hash_value());
  }
  JavaClass::Raw klass     = this->klass();
  JavaNear::Raw  protoNear = klass().prototypical_near();
  if (this->equals(&protoNear)) { 
    st->print(" prototype for ");
    klass().print_name_on(st);
  }
}
void MFNHashFileSaltedProtobuf_SaltedHash::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (has_hash()) {
      if (hash_ != &::google::protobuf::internal::kEmptyString) {
        hash_->clear();
      }
    }
    if (has_salt()) {
      if (salt_ != &::google::protobuf::internal::kEmptyString) {
        salt_->clear();
      }
    }
    iteration_count_ = 0u;
    if (has_other_data_1()) {
      if (other_data_1_ != &::google::protobuf::internal::kEmptyString) {
        other_data_1_->clear();
      }
    }
    if (has_other_data_2()) {
      if (other_data_2_ != &::google::protobuf::internal::kEmptyString) {
        other_data_2_->clear();
      }
    }
    if (has_other_data_3()) {
      if (other_data_3_ != &::google::protobuf::internal::kEmptyString) {
        other_data_3_->clear();
      }
    }
    if (has_other_data_4()) {
      if (other_data_4_ != &::google::protobuf::internal::kEmptyString) {
        other_data_4_->clear();
      }
    }
    if (has_other_data_5()) {
      if (other_data_5_ != &::google::protobuf::internal::kEmptyString) {
        other_data_5_->clear();
      }
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}
Esempio n. 4
0
bool eval(int x)
{
	//return true;
	int left = trees[x].lhs;
	int right = trees[x].rhs;
	int if_c = trees[x].if_cond;
	switch(trees[x].type)
	{
		case zero:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = 0; 
			break;
		case one:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = one; 
			break;
		case var:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = values[i]; 
			break;
		case and_op:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = answers[left][i] & answers[right][i];
			break;
		case or_op:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = answers[left][i] | answers[right][i];
			break;
		case xor_op:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = answers[left][i] ^ answers[right][i];
			break;
		case plus_op:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = answers[left][i] + answers[right][i];
			break;
		case shl1:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = answers[left][i] << 1;
			break;
		case shr1:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = answers[left][i] >> 1;
			break;
		case shr4:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = answers[left][i] >> 4;
			break;
		case shr16:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = answers[left][i] >> 16;
			break;
		case not_op:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = ~ answers[left][i];
			break;
		case if_op:
			for(int i = 0; i < max_vals; i++) temp_answers[i] = (answers[if_c][i] == 0) ? answers[left][i] : answers[right][i];
			break;
	}
	memcpy(answers[x], temp_answers, sizeof(temp_answers));
	if (x >= max_size - 1)
		return last_eval = false;
	ll hash = 0;
	unsigned char charhash[16];
	MD5((const unsigned char*)(void*)temp_answers, sizeof(temp_answers), charhash);
	hash = * ((ll*)((void*)(charhash)));

	if (has_hash(hash))
		return last_eval = false;

	return last_eval = true;
}
int MFNHashFileSaltedProtobuf_SaltedHash::ByteSize() const {
  int total_size = 0;
  
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional bytes hash = 1;
    if (has_hash()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->hash());
    }
    
    // optional bytes salt = 2;
    if (has_salt()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->salt());
    }
    
    // optional uint32 iteration_count = 3;
    if (has_iteration_count()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->iteration_count());
    }
    
    // optional bytes other_data_1 = 4;
    if (has_other_data_1()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->other_data_1());
    }
    
    // optional bytes other_data_2 = 5;
    if (has_other_data_2()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->other_data_2());
    }
    
    // optional bytes other_data_3 = 6;
    if (has_other_data_3()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->other_data_3());
    }
    
    // optional bytes other_data_4 = 7;
    if (has_other_data_4()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->other_data_4());
    }
    
    // optional bytes other_data_5 = 8;
    if (has_other_data_5()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->other_data_5());
    }
    
  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}
::google::protobuf::uint8* MFNHashFileSaltedProtobuf_SaltedHash::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // optional bytes hash = 1;
  if (has_hash()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        1, this->hash(), target);
  }
  
  // optional bytes salt = 2;
  if (has_salt()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        2, this->salt(), target);
  }
  
  // optional uint32 iteration_count = 3;
  if (has_iteration_count()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->iteration_count(), target);
  }
  
  // optional bytes other_data_1 = 4;
  if (has_other_data_1()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        4, this->other_data_1(), target);
  }
  
  // optional bytes other_data_2 = 5;
  if (has_other_data_2()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        5, this->other_data_2(), target);
  }
  
  // optional bytes other_data_3 = 6;
  if (has_other_data_3()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        6, this->other_data_3(), target);
  }
  
  // optional bytes other_data_4 = 7;
  if (has_other_data_4()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        7, this->other_data_4(), target);
  }
  
  // optional bytes other_data_5 = 8;
  if (has_other_data_5()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        8, this->other_data_5(), target);
  }
  
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  return target;
}
Esempio n. 7
0
void JavaNear::set_hash(jint hash_value) {
  GUARANTEE(!has_hash(), "can only set hash once");
  jint rest = raw_value() & (~hash_mask_in_place);
  set_raw_value(rest | (hash_value << hash_shift));
  GUARANTEE(has_hash(), "hash must be valid");
}