Ejemplo n.º 1
0
  bool BlogDropServer::AddServerCiphertext(const QByteArray &in,
      QSharedPointer<const PublicKey> from)
  {
    QSharedPointer<const ServerCiphertext> s = CiphertextFactory::CreateServerCiphertext(
        _params, _client_pks, _author_pub, _client_ciphertexts, in);

    bool okay = s->VerifyProof(_phase, from); 
    if(okay)
      _server_ciphertexts.append(s);

    return okay;
  }
Ejemplo n.º 2
0
  bool BlogDropServer::AddClientCiphertext(QByteArray in, 
      QSharedPointer<const PublicKey> pub, bool verify_proofs)
  {
    QSharedPointer<ClientCiphertext> c = CiphertextFactory::CreateClientCiphertext(_params, 
            _server_pk_set, _author_pub, in);


    bool valid;
    if(verify_proofs) {
      valid = c->VerifyProof(_phase, pub);
      if(valid) {
        _client_ciphertexts.append(c);
        _client_pubs.append(pub);
      }
    } else {
      _client_ciphertexts.append(c);
      _client_pubs.append(pub);
      valid = true;
    }

    return valid;
  }