Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
ffe102ca
Commit
ffe102ca
authored
Mar 31, 2017
by
davidcunado-arm
Committed by
GitHub
Mar 31, 2017
Browse files
Merge pull request #874 from dp-arm/dp/mbed-macros
mbedtls: Namespace TF specific macros
parents
ddc1c56f
66b4c166
Changes
3
Show whitespace changes
Inline
Side-by-side
drivers/auth/mbedtls/mbedtls_common.c
View file @
ffe102ca
/*
/*
* Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015
-2017
, ARM Limited and Contributors. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* modification, are permitted provided that the following conditions are met:
...
@@ -36,9 +36,9 @@
...
@@ -36,9 +36,9 @@
/*
/*
* mbed TLS heap
* mbed TLS heap
*/
*/
#if (
MBEDTLS
_KEY_ALG_ID ==
MBEDTLS
_ECDSA)
#if (
TBBR
_KEY_ALG_ID ==
TBBR
_ECDSA)
#define MBEDTLS_HEAP_SIZE (14*1024)
#define MBEDTLS_HEAP_SIZE (14*1024)
#elif (
MBEDTLS
_KEY_ALG_ID ==
MBEDTLS
_RSA)
#elif (
TBBR
_KEY_ALG_ID ==
TBBR
_RSA)
#define MBEDTLS_HEAP_SIZE (8*1024)
#define MBEDTLS_HEAP_SIZE (8*1024)
#endif
#endif
static
unsigned
char
heap
[
MBEDTLS_HEAP_SIZE
];
static
unsigned
char
heap
[
MBEDTLS_HEAP_SIZE
];
...
...
drivers/auth/mbedtls/mbedtls_crypto.mk
View file @
ffe102ca
#
#
# Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
# Copyright (c) 2015
-2017
, ARM Limited and Contributors. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# modification, are permitted provided that the following conditions are met:
...
@@ -55,18 +55,18 @@ ifeq (${MBEDTLS_KEY_ALG},ecdsa)
...
@@ -55,18 +55,18 @@ ifeq (${MBEDTLS_KEY_ALG},ecdsa)
ecp_curves.c
\
ecp_curves.c
\
ecp.c
\
ecp.c
\
)
)
MBEDTLS
_KEY_ALG_ID
:=
MBEDTLS
_ECDSA
TBBR
_KEY_ALG_ID
:=
TBBR
_ECDSA
else
ifeq
(${MBEDTLS_KEY_ALG},rsa)
else
ifeq
(${MBEDTLS_KEY_ALG},rsa)
MBEDTLS_CRYPTO_SOURCES
+=
$(
addprefix
${MBEDTLS_DIR}
/library/,
\
MBEDTLS_CRYPTO_SOURCES
+=
$(
addprefix
${MBEDTLS_DIR}
/library/,
\
rsa.c
\
rsa.c
\
)
)
MBEDTLS
_KEY_ALG_ID
:=
MBEDTLS
_RSA
TBBR
_KEY_ALG_ID
:=
TBBR
_RSA
else
else
$(error
"MBEDTLS_KEY_ALG=${MBEDTLS_KEY_ALG} not supported on mbed TLS"
)
$(error
"MBEDTLS_KEY_ALG=${MBEDTLS_KEY_ALG} not supported on mbed TLS"
)
endif
endif
#
mbed TLS libraries rely on this define to build
correctly
#
Needs to be set to drive mbed TLS configuration
correctly
$(eval
$(call
add_define,
MBEDTLS
_KEY_ALG_ID))
$(eval
$(call
add_define,
TBBR
_KEY_ALG_ID))
BL1_SOURCES
+=
${MBEDTLS_CRYPTO_SOURCES}
BL1_SOURCES
+=
${MBEDTLS_CRYPTO_SOURCES}
BL2_SOURCES
+=
${MBEDTLS_CRYPTO_SOURCES}
BL2_SOURCES
+=
${MBEDTLS_CRYPTO_SOURCES}
include/drivers/auth/mbedtls/mbedtls_config.h
View file @
ffe102ca
/*
/*
* Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015
-2017
, ARM Limited and Contributors. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* modification, are permitted provided that the following conditions are met:
...
@@ -33,8 +33,8 @@
...
@@ -33,8 +33,8 @@
/*
/*
* Key algorithms currently supported on mbed TLS libraries
* Key algorithms currently supported on mbed TLS libraries
*/
*/
#define
MBEDTLS
_RSA
1
#define
TBBR
_RSA 1
#define
MBEDTLS
_ECDSA
2
#define
TBBR
_ECDSA 2
/*
/*
* Configuration file to build mbed TLS with the required features for
* Configuration file to build mbed TLS with the required features for
...
@@ -69,11 +69,11 @@
...
@@ -69,11 +69,11 @@
#define MBEDTLS_PLATFORM_C
#define MBEDTLS_PLATFORM_C
#if (
MBEDTLS
_KEY_ALG_ID ==
MBEDTLS
_ECDSA)
#if (
TBBR
_KEY_ALG_ID ==
TBBR
_ECDSA)
#define MBEDTLS_ECDSA_C
#define MBEDTLS_ECDSA_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#elif (
MBEDTLS
_KEY_ALG_ID ==
MBEDTLS
_RSA)
#elif (
TBBR
_KEY_ALG_ID ==
TBBR
_RSA)
#define MBEDTLS_RSA_C
#define MBEDTLS_RSA_C
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment