[gnutls-help] GnuTLS on ARMv7 and HardFP

Mandar Joshi emailmandar at gmail.com
Thu Jun 15 09:53:18 CEST 2017


<n.mavrogiannopoulos at gmail.com> wrote:
> Check the gnutls_cipher_aead* functions at:
> https://www.gnutls.org/manual/html_node/Symmetric-algorithms.html
>

I must be missing something very simple. gnutls_aead_cipher_init (...)
is failing.


-----------------------------------------------------------------------------------------------------
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>
#include <assert.h>
int main (int argc, char *argv[]) {
  unsigned char key[32];
  size_t ctext_len, ptext_len;
  gnutls_aead_cipher_hd_t handle;
  gnutls_datum_t dkey;

  assert(gnutls_rnd(GNUTLS_RND_NONCE, key, sizeof(key)) >= 0);

  dkey.data = (void*) key;
  dkey.size = gnutls_cipher_get_key_size (GNUTLS_CIPHER_AES_256_CBC);
  assert(gnutls_aead_cipher_init(&handle, GNUTLS_CIPHER_AES_256_CBC,
&dkey) >= 0);
  return 0;
}
-----------------------------------------------------------------------------------------------------

fail: fail.c:14: main: Assertion `gnutls_aead_cipher_init(&handle,
GNUTLS_CIPHER_AES_256_CBC, &dkey) >= 0' failed.
Aborted (core dumped)

What am I doing wrong?

Thanks
Mandar Joshi



More information about the Gnutls-help mailing list