X-Git-Url: https://git.siccegge.de//index.cgi?p=software%2FDIPE.git;a=blobdiff_plain;f=doc%2Fsource%2Fapi.rst;h=0da1209484b25fc8eafbb825fb398b0c3af6c9f7;hp=8fbdb35b19614427cb95a541046c1a6e1f40ba43;hb=228b4f8c2255acb701fd669161f62c1f777a0a98;hpb=2d85aad0494ae9dbfec3cfa7bac0883b5983cc92 diff --git a/doc/source/api.rst b/doc/source/api.rst index 8fbdb35..0da1209 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -45,7 +45,7 @@ Initialization .. c:function:: void dipe_init(FILE* configfp, dipe_param_t* param) Initializes public parameters as well as the PBC library. The - function allocates data for the `param` structure that needs to be + function allocates data for the ``param`` structure that needs to be freed with :c:func:`dipe_free_param`. :param configfp: File structure holding the pairing group definition as understood by PBC @@ -56,9 +56,9 @@ Key Generation .. c:function:: void dipe_master_keygen(dipe_param_t param, size_t dimension, dipe_master_publickey_t* pk, dipe_master_secretkey_t* sk) - Generate a keypair for an authority. The `dimension` is supposed to + Generate a keypair for an authority. The ``dimension`` is supposed to be a system parameter and needs to be consistently used for all - operations. The function allocates data for the `pk` and `sk` + operations. The function allocates data for the ``pk`` and ``sk`` structures that need to be freed with :c:func:`dipe_free_master_publickey` and :c:func:`dipe_free_master_secretkey` respectively. @@ -71,12 +71,12 @@ Key Generation .. c:function:: void dipe_keygen(dipe_param_t param, dipe_master_secretkey_t msk, char* cid, element_t* y, dipe_secretkey_t* sk) Issues a secretkey for a used identified by the 16-bit string - `cid`. The element vector `y` is expected to be an array of - `dimension` many elements. The function allocates data for the `sk` + ``cid``. The element vector ``y`` is expected to be an array of + ``dimension`` many elements. The function allocates data for the ``sk`` structure that need to be freed with :c:func:`dipe_free_secretkey`. :param char* cid: Client ID, expected to be 16 bytes - :param y: Policy vector for the secret key that is to be generated. Must match with the dimensions when `msk` was generated + :param y: Policy vector for the secret key that is to be generated. Must match with the dimensions when ``msk`` was generated :type y: Array of Zn elements En-/Decryption @@ -84,9 +84,9 @@ En-/Decryption .. c:function:: void dipe_encrypt(dipe_param_t param, dipe_master_publickey_t mpk, element_t* x, size_t ptxt_len, char* ptxt, size_t ctxt_len, char* ctxt) - Creates a DIPE ciphertext of exactly length `ctxt_len` for a policy - vector `x` from some plaintext. `ctxt_len` needs to be large enough - to store `ptxt_len` + :c:func:`dipe_ciphertext_overhead` many bytes + Creates a DIPE ciphertext of exactly length ``ctxt_len`` for a policy + vector ``x`` from some plaintext. ``ctxt_len`` needs to be large enough + to store ``ptxt_len`` + :c:func:`dipe_ciphertext_overhead` many bytes but may be arbitrarily larger. :param dipe_param_t param: Public Parameters @@ -99,10 +99,10 @@ En-/Decryption .. c:function:: size_t dipe_decrypt(dipe_param_t param, dipe_secretkey_t sk, char* cid, element_t* y, size_t ctxt_len, char* ctxt, char* ptxt) - Decrypts a DIPE ciphertext. The buffer `ptxt` needs to be able to - hold at least `ctxt_len` - :c:func:`dipe_ciphertext_overhead` many + Decrypts a DIPE ciphertext. The buffer ``ptxt`` needs to be able to + hold at least ``ctxt_len`` - :c:func:`dipe_ciphertext_overhead` many bytes. The function returns the length of the recovered plaintext - but may modify the remaining bits of the `ptxt` buffer as well. + but may modify the remaining bits of the ``ptxt`` buffer as well. :param dipe_param_t param: Public Parameters :param dipe_secretkey_t sk: User Secretkey