Commit Graph

9 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
Jon Shallow
927dc716d3 hmac.h: Add in ESP-IDF sha256 versions
For ESP-IDF, use the ESP-IDF sha256 hash implementation to save on code
size.

[Test for ESP_PLATFORM and CONFIG_LIBSODIUM_USE_MBEDTLS_SHA]

Signed-off-by: Jon Shallow <supjps-libcoap@jpshallow.com>
2019-04-25 14:34:17 +01:00
Olaf Bergmann
6dd3fbbce5 hmac.h: cleanup pre-processor conditionals
This moves the mapping of function names and types for sha256
calculations into a single conditional section at the beginning
of the file in order to  minimize the number of pre-processor
conditionals spread throughout the code.

Change-Id: Iad02455e1fdb22f7a17bba0a9f2ac4750826bcc3
2018-02-16 10:27:21 +01:00
Raul Fuentes
dafd12eb8b hmac: Make use of RIOT's sha2 functions
Change-Id: I08c0ff761bdd2874a9b996882b28699b4289b675
Signed-off-by: Raul Fuentes <ra.fuentes.sam@gmail.com>
2018-02-16 10:27:21 +01: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
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
ae385945ed fixed function prototypes to shutup compiler warnings 2016-04-22 14:09:51 +02:00
Kyungsun Cho
1ddeffa2a9 bug 490467: Renamed |SHA| symbol names on |sha2| module
this change is for resolving |sha2| symbol-conflict in using
|tinydtls| with other crypto modules. this symbol-conflict could
occur on the |tinydtls|-deployed systems with using |OpenSSL| or
|OpenSSL|-like, which has another |SHA| symbols.
In case of |iotivity-tinydtls|, the conflict occurs between
|iotivity-tinydtls| and the deployed |crypto| library, which has
also another |SHA|.

[patch #1] initial commit
[patch #2-3] updated commit message
[patch #4] reverted renaming for internal symbols
[patch #5] updated symbols with lower-case
[patch #6] fixed typo for calling API

bugs: https://bugs.eclipse.org/bugs/show_bug.cgi?id=490467

Change-Id: I6942870c7c31544e89a20209d21730406ffb08d2
Signed-off-by: Kyungsun Cho <goodsun.cho@samsung.com>
2016-04-20 16:36:39 +09:00
Olaf Bergmann
e1388b3980 New initial commit 2016-02-02 18:39:21 +01:00