예제 #1
0
static HPDF_STATUS
BeforeWrite  (HPDF_Dict   obj)
{
    HPDF_PTRACE ((" HPDF_TTFont_BeforeWrite\n"));

    return CreateDescriptor (obj);
}
예제 #2
0
      virtual QPair<QByteArray, bool> GetBulkData(int)
      {
        QByteArray data(1024, 0);
        CreateDescriptor(data);

        SetTriggered();
        int my_idx = GetGroup().GetIndex(GetLocalId());
        int bad = Random::GetInstance().GetInt(0, GetGroup().Count());
        while(bad == my_idx) {
          bad = Random::GetInstance().GetInt(0, GetGroup().Count());
        }

        qDebug() << my_idx << "setting bad hash at" << bad;
        const Descriptor &cdes = GetMyDescriptor();
        QVector<QByteArray> hashes = cdes.XorMessageHashes();

        hashes[bad] = Hash().ComputeHash(data);

        Descriptor descriptor(cdes.Length(), cdes.PublicDh(), hashes,
            cdes.CleartextHash());
        SetMyDescriptor(descriptor);

        QByteArray my_desc;
        QDataStream desstream(&my_desc, QIODevice::WriteOnly);
        desstream << GetMyDescriptor();
        return QPair<QByteArray, bool>(my_desc, false);
      }
예제 #3
0
MP4Descriptor* MP4DescriptorProperty::AddDescriptor(u_int8_t tag)
{
	// check that tag is in expected range
	ASSERT(tag >= m_tagsStart && tag <= m_tagsEnd);

	MP4Descriptor* pDescriptor = CreateDescriptor(tag);
	ASSERT(pDescriptor);

	m_pDescriptors.Add(pDescriptor);
	pDescriptor->SetParentAtom(m_pParentAtom);

	return pDescriptor;
}
예제 #4
0
  QPair<QByteArray, bool> BulkRound::GetBulkData(int max)
  {
    QPair<QByteArray, bool> pair = GetData(max);
    const QByteArray &data = pair.first;

    if(data.size() == 0) {
      return QPair<QByteArray, bool>(QByteArray(), false);
    }

    CreateDescriptor(pair.first);

    QByteArray my_desc;
    QDataStream desstream(&my_desc, QIODevice::WriteOnly);
    desstream << GetMyDescriptor();
    return QPair<QByteArray, bool>(my_desc, false);
  }