Remove TinyCrypt config condition in source files

This commit removes from the TinyCrypt header and source code files, the
configuration condition on MBEDTLS_USE_TINYCRYPT to include the file
contents.

This is to allow use of the library by the Factory Tool without enabling
MBEDTLS_USE_TINYCRYPT, and also removes a modification we've made to make the
code closer to the upstream TinyCrypt making it easier to maintain.
This commit is contained in:
Simon Butcher 2019-11-21 17:17:05 +00:00
parent a3877007e6
commit 35e535a74a
6 changed files with 0 additions and 18 deletions

View file

@ -73,7 +73,6 @@
*
*/
#if defined(MBEDTLS_USE_TINYCRYPT)
#ifndef __TC_UECC_H__
#define __TC_UECC_H__
@ -528,4 +527,3 @@ void uECC_vli_bytesToNative(unsigned int *native, const uint8_t *bytes,
#endif
#endif /* __TC_UECC_H__ */
#endif /* MBEDTLS_USE_TINYCRYPT */

View file

@ -71,7 +71,6 @@
* Security: The curve NIST p-256 provides approximately 128 bits of security.
*/
#if defined(MBEDTLS_USE_TINYCRYPT)
#ifndef __TC_ECC_DH_H__
#define __TC_ECC_DH_H__
@ -135,4 +134,3 @@ int uECC_shared_secret(const uint8_t *p_public_key, const uint8_t *p_private_key
#endif
#endif /* __TC_ECC_DH_H__ */
#endif /* MBEDTLS_USE_TINYCRYPT */

View file

@ -80,7 +80,6 @@
* the signer's public key and the signature values (r and s).
*/
#if defined(MBEDTLS_USE_TINYCRYPT)
#ifndef __TC_ECC_DSA_H__
#define __TC_ECC_DSA_H__
@ -143,4 +142,3 @@ int uECC_verify(const uint8_t *p_public_key, const uint8_t *p_message_hash,
#endif
#endif /* __TC_ECC_DSA_H__ */
#endif /* MBEDTLS_USE_TINYCRYPT */

View file

@ -63,7 +63,6 @@
#include MBEDTLS_CONFIG_FILE
#endif
#if defined(MBEDTLS_USE_TINYCRYPT)
#include <tinycrypt/ecc.h>
#include "mbedtls/platform_util.h"
#include <string.h>
@ -1114,7 +1113,4 @@ int uECC_compute_public_key(const uint8_t *private_key, uint8_t *public_key,
curve->num_bytes, curve->num_bytes, _public + curve->num_words);
return 1;
}
#else
typedef int mbedtls_dummy_tinycrypt_def;
#endif /* MBEDTLS_USE_TINYCRYPT */

View file

@ -66,7 +66,6 @@
#include MBEDTLS_CONFIG_FILE
#endif
#if defined(MBEDTLS_USE_TINYCRYPT)
#include <tinycrypt/ecc.h>
#include <tinycrypt/ecc_dh.h>
#include <string.h>
@ -188,6 +187,3 @@ clear_and_out:
return r;
}
#else
typedef int mbedtls_dummy_tinycrypt_def;
#endif /* MBEDTLS_USE_TINYCRYPT */

View file

@ -64,7 +64,6 @@
#include MBEDTLS_CONFIG_FILE
#endif
#if defined(MBEDTLS_USE_TINYCRYPT)
#include <tinycrypt/ecc.h>
#include <tinycrypt/ecc_dsa.h>
@ -303,6 +302,3 @@ int uECC_verify(const uint8_t *public_key, const uint8_t *message_hash,
/* Accept only if v == r. */
return (int)(uECC_vli_equal(rx, r) == 0);
}
#else
typedef int mbedtls_dummy_tinycrypt_def;
#endif /* MBEDTLS_USE_TINYCRYPT */