quanluno mi sa dire come si utilizza questa funzione?
codice:
gcry_error_t gcry_ac_data_sign (gcry_ac_handle_t handle, gcry_ac_key_t key, gcry_mpi_t data, gcry_ac_data_t *data_signature)
Signs the data contained in data with the secret key key and stores the resulting signature in the data set data_signature.
Il mio problema sostanzialmente sta nel non saper inserire all'interno di "gcry_mpi_t data" i miei dati, che in questo caso sono all'interno della una struttura.
Cmq mi accontento anche di un esempio dove si riempi "gcry_mpi_t data" con una stringa o una qualunque altra cosa, l'importante che si diversa da un numero.
Deve essere diversa da un numero perchè nell'interfaccia della libreria esiste questa funzione:
codice:
gcry_mpi_t gcry_mpi_set_ui (gcry_mpi_t w, unsigned long u)
Assign the value of u to w and return w. If NULL is passed for w, a new MPI is allocated, set to the value of u and returned. This function takes an unsigned int as type for u and thus it is only possible to set w to small values (usually up to the word size of the CPU).
che permette proprio di riempire "gcry_mpi_t w" con un numero, ma io invece deve mettere una struttura.
Grazie a tutti.