Commit Graph

8 Commits

Author SHA1 Message Date
Martine S. Lenders
47289eec09 crypto: remove unnecessary usage of malloc()/dtls_hmac_new()
This has the following optimization potentials which are also applied.

- crypto: only one HMAC context is required
- crypto: integrate last iteration into loop
- hmac: remove dtls_hmac_new()/_free()/_storage_init() as dtls_hmac_new()
  now only is used in tests

Co-Authored-By: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
Signed-off-by: Martine Lenders <m.lenders@fu-berlin.de>
2022-05-23 10:29:01 +02:00
Olaf Bergmann
8c9458335d hmac.c: Fix logic for including assert.h
HAVE_ASSERT_H is controlled by tinydtls.h which must be included
first. assert.h is included only if assert() is not defined already.

Change-Id: Ib28e5d9452c9f263c02363bb5c2780c68d77017b
2020-05-10 14:18:20 +02:00
Olaf Bergmann
51f3e08bd8 hmac.c: include assert.h only if assert() is not defined
To avoid multiple definitions of assert(), the header assert.h is
included only if assert() is not defined.

Change-Id: Ib598248d1675da4d5225d9700f6133be525d5d42
2020-05-10 14:11:46 +02:00
Olaf Bergmann
12edf4defb hmac.[hc]: move dtls_hmac_storage_init() to .c file
For platforms other than Contiki, dtls_hmac_storage_init() was
defined inline in hmac.h which cluttered the interface.

Change-Id: I9eb1f0b6a299ef3b60560b3d529dde39d610cd33
2017-11-30 11:07:21 +01:00
Olaf Bergmann
320c04b96d Fixes for compiler warnings
The code has been cleaned up to
1. provide proper prototypes for functions that take no arguments (void),
2. avoid signedness issues, and
3. provide missing cases for switch statements.

Change-Id: I9e84ddb9ef6594c374ad817330a43b22642ebb33
2017-03-01 13:32:14 +01:00
Gaëtan Harter
c9adbab655 tinydtls.h: include dtls_config.h in tinydtls.h
Fixes dtls_config.h not visible in headers
Include dtls_config.h in tinydtls.h and include tinydtls.h in all necessary
headers.

Remaining headers do not use 'ifdef', but they may require it too.

Change-Id: I39c86dffc8bbc8bd7551e74386994f92f49d00ec
Signed-off-by: Gaëtan Harter <gaetan.harter@inria.fr>
2017-02-27 18:05:10 +01:00
Olaf Bergmann
f623c23ba4 renamed debug.[hc] to dtls_debug.[hc] to avoid naming conflicts 2016-03-08 12:47:11 +01:00
Olaf Bergmann
e1388b3980 New initial commit 2016-02-02 18:39:21 +01:00