Skip to content

Commit 7cbfa84

Browse files
kotkcyromanjoe
authored andcommitted
Initial commit to add mbedTLS hardware acceleration for Cypress chips to mbed-os sources
1 parent 940d3fd commit 7cbfa84

File tree

19 files changed

+6511
-1
lines changed

19 files changed

+6511
-1
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* mbed Microcontroller Library
3+
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
4+
* Copyright (C) 2019 Cypress Semiconductor Corporation
5+
* SPDX-License-Identifier: Apache-2.0
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
8+
* not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
/**
21+
* \file sha1_alt.h
22+
* \version 1.0
23+
*
24+
* \brief header file - wrapper for mbedtls SHA1 HW acceleration
25+
*
26+
*/
27+
28+
#if !defined(SHA1_ALT_H)
29+
#define SHA1_ALT_H
30+
31+
#if !defined(MBEDTLS_CONFIG_FILE)
32+
#include "config.h"
33+
#else
34+
#include MBEDTLS_CONFIG_FILE
35+
#endif
36+
37+
#include "crypto_common.h"
38+
39+
#if defined(MBEDTLS_SHA1_ALT)
40+
41+
typedef struct mbedtls_sha1_context {
42+
cy_hw_crypto_t obj;
43+
cy_stc_crypto_sha_state_t hashState; /* Structure used by CY Crypto Driver */
44+
cy_stc_crypto_v1_sha1_buffers_t shaBuffers; /* Structure used by CY Crypto Driver */
45+
}
46+
mbedtls_sha1_context;
47+
48+
#endif /* MBEDTLS_SHA1_ALT */
49+
50+
#endif /* (SHA1_ALT_H) */
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* mbed Microcontroller Library
3+
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
4+
* Copyright (C) 2019 Cypress Semiconductor Corporation
5+
* SPDX-License-Identifier: Apache-2.0
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
8+
* not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
/**
21+
* \file sha256_alt.h
22+
* \version 1.0
23+
*
24+
* \brief header file - wrapper for mbedtls SHA256 HW acceleration
25+
*
26+
*/
27+
28+
29+
#if !defined(SHA256_ALT_H)
30+
#define SHA256_ALT_H
31+
32+
#if !defined(MBEDTLS_CONFIG_FILE)
33+
#include "config.h"
34+
#else
35+
#include MBEDTLS_CONFIG_FILE
36+
#endif
37+
38+
#include "crypto_common.h"
39+
40+
#if defined(MBEDTLS_SHA256_ALT)
41+
42+
typedef struct mbedtls_sha256_context {
43+
cy_hw_crypto_t obj;
44+
cy_stc_crypto_sha_state_t hashState; /* Structure used by CY Crypto Driver */
45+
cy_stc_crypto_v1_sha256_buffers_t shaBuffers; /* Structure used by CY Crypto Driver */
46+
}
47+
mbedtls_sha256_context;
48+
49+
#endif /* MBEDTLS_SHA256_ALT */
50+
51+
#endif /* (SHA256_ALT_H) */
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* mbed Microcontroller Library
3+
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
4+
* Copyright (C) 2019 Cypress Semiconductor Corporation
5+
* SPDX-License-Identifier: Apache-2.0
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
8+
* not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
/**
21+
* \file sha512_alt.h
22+
* \version 1.0
23+
*
24+
* \brief header file - wrapper for mbedtls SHA512 HW acceleration
25+
*
26+
*/
27+
28+
#if !defined(SHA512_ALT_H)
29+
#define SHA512_ALT_H
30+
31+
#if !defined(MBEDTLS_CONFIG_FILE)
32+
#include "config.h"
33+
#else
34+
#include MBEDTLS_CONFIG_FILE
35+
#endif
36+
37+
#include "crypto_common.h"
38+
39+
#if defined(MBEDTLS_SHA512_ALT)
40+
41+
typedef struct mbedtls_sha512_context {
42+
cy_hw_crypto_t obj;
43+
cy_stc_crypto_sha_state_t hashState; /* Structure used by CY Crypto Driver */
44+
cy_stc_crypto_v1_sha512_buffers_t shaBuffers; /* Structure used by CY Crypto Driver */
45+
}
46+
mbedtls_sha512_context;
47+
48+
#endif /* MBEDTLS_SHA512_ALT */
49+
50+
#endif /* (SHA512_ALT_H) */
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* mbed Microcontroller Library
3+
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
4+
* Copyright (C) 2019 Cypress Semiconductor Corporation
5+
* SPDX-License-Identifier: Apache-2.0
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
8+
* not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
/**
21+
* \file sha1_alt.h
22+
* \version 1.0
23+
*
24+
* \brief header file - wrapper for mbedtls SHA1 HW acceleration
25+
*
26+
*/
27+
28+
#if !defined(SHA1_ALT_H)
29+
#define SHA1_ALT_H
30+
31+
#if !defined(MBEDTLS_CONFIG_FILE)
32+
#include "config.h"
33+
#else
34+
#include MBEDTLS_CONFIG_FILE
35+
#endif
36+
37+
#include "crypto_common.h"
38+
39+
#if defined(MBEDTLS_SHA1_ALT)
40+
41+
typedef struct mbedtls_sha1_context {
42+
cy_hw_crypto_t obj;
43+
cy_stc_crypto_sha_state_t hashState; /* Structure used by CY Crypto Driver */
44+
cy_stc_crypto_v2_sha1_buffers_t shaBuffers; /* Structure used by CY Crypto Driver */
45+
}
46+
mbedtls_sha1_context;
47+
48+
#endif /* MBEDTLS_SHA1_ALT */
49+
50+
#endif /* (SHA1_ALT_H) */
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* mbed Microcontroller Library
3+
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
4+
* Copyright (C) 2019 Cypress Semiconductor Corporation
5+
* SPDX-License-Identifier: Apache-2.0
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
8+
* not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
/**
21+
* \file sha256_alt.h
22+
* \version 1.0
23+
*
24+
* \brief header file - wrapper for mbedtls SHA256 HW acceleration
25+
*
26+
*/
27+
28+
29+
#if !defined(SHA256_ALT_H)
30+
#define SHA256_ALT_H
31+
32+
#if !defined(MBEDTLS_CONFIG_FILE)
33+
#include "config.h"
34+
#else
35+
#include MBEDTLS_CONFIG_FILE
36+
#endif
37+
38+
#include "crypto_common.h"
39+
40+
#if defined(MBEDTLS_SHA256_ALT)
41+
42+
typedef struct mbedtls_sha256_context {
43+
cy_hw_crypto_t obj;
44+
cy_stc_crypto_sha_state_t hashState; /* Structure used by CY Crypto Driver */
45+
cy_stc_crypto_v2_sha256_buffers_t shaBuffers; /* Structure used by CY Crypto Driver */
46+
}
47+
mbedtls_sha256_context;
48+
49+
#endif /* MBEDTLS_SHA256_ALT */
50+
51+
#endif /* (SHA256_ALT_H) */
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* mbed Microcontroller Library
3+
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
4+
* Copyright (C) 2019 Cypress Semiconductor Corporation
5+
* SPDX-License-Identifier: Apache-2.0
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
8+
* not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
/**
21+
* \file sha512_alt.h
22+
* \version 1.0
23+
*
24+
* \brief header file - wrapper for mbedtls SHA512 HW acceleration
25+
*
26+
*/
27+
28+
#if !defined(SHA512_ALT_H)
29+
#define SHA512_ALT_H
30+
31+
#if !defined(MBEDTLS_CONFIG_FILE)
32+
#include "config.h"
33+
#else
34+
#include MBEDTLS_CONFIG_FILE
35+
#endif
36+
37+
#include "crypto_common.h"
38+
39+
#if defined(MBEDTLS_SHA512_ALT)
40+
41+
typedef struct mbedtls_sha512_context {
42+
cy_hw_crypto_t obj;
43+
cy_stc_crypto_sha_state_t hashState; /* Structure used by CY Crypto Driver */
44+
cy_stc_crypto_v2_sha512_buffers_t shaBuffers; /* Structure used by CY Crypto Driver */
45+
}
46+
mbedtls_sha512_context;
47+
48+
#endif /* MBEDTLS_SHA512_ALT */
49+
50+
#endif /* (SHA512_ALT_H) */

0 commit comments

Comments
 (0)