Queries on Encrypted Data Library

Query has only one step, running QED_Query.
An example is presented at the end.

QED_Query takes in the token, the ciphertext, and the context. It returns an integer specifying the output of the query.

int QED_Query(
        QEDMessageKey_t *M,
        QEDToken_t *Token,
        QEDEncryption_t *C,
        QED_CTX *c);

If the MessageKey is populated, then the query returned success. You can use the MessageKey to derive a symmetric key and decrypt data. For more information, please see QED Internals

If the MessageKey is null, then the answer to the query returned failure.



Example

This example builds on top of the example started in the setup section, and continued in the gentoken and encryption sections.

First, declare a context, a message key, a token and a cipher text variable.

	QED_CTX c;
	QEDMessageKey_t MsgKey;
	QEDToken_t Token;
	QEDEncryption_t Cipher;


Second, obtain the token.

Third, obtain the cipher text.

Fourth, compute the token.
	QED_Query(&MsgKey, &Token, &Cipher, &c);