Queries on Encrypted Data Library

GenToken has three steps: Initialize the HVE, Populate the HVE, and run QED_GenToken.
An example is presented at the end.

  1. Initialize HVE:

    To initialize an HVE for the token function, simply call HVE_Init_Token with the Private Key. This can be done only after the Setup has been ran, and a Private Key has been generated;
    int HVE_Init_Token(
    		HVE_t *HVE, 
    		QEDPrivateKey_t *PrivKey);

  2. Populate HVE:

    Please refer to the subsection on Populating the HVE.

  3. Run QED_GenToken:

    QED_GenToken will take in the Private Key, the HVE and the context, and populate a QED_Token_t.
    int QED_GenToken(
    	        QEDToken_t *Token,
         	   	QEDPrivateKey_t *PrivKey,
          	  	HVE_t *HVE,
           		QED_CTX *c);


This example builds on top of the example started in the setup section.

First, declare a context, a token, a private key and an HVE variable.

	QEDToken_t Token;
	QEDPrivateKey_t PrivKey;

Second, initialize the context variable to use TYPE1 algorithm.
        QED_Init(&c, TYPE1);

Third, obtain the private key.

Fourth, initialize the HVE with the Private Key.
	HVE_Init_Token(&HVE, &PrivKey);

Fifth, populate the HVE with appropriate data.

Finally, generate the token for the above HVE.
	QED_GenToken(&Token, &PrivKey, &HVE, &c);