cube bite crypto lib
Dependents: CEBF746_Slave_withTPM
Diff: cube_crypto.h
- Revision:
- 2:47e48f68e858
- Parent:
- 0:f0000829c039
- Child:
- 4:0a155e03336e
--- a/cube_crypto.h Thu Oct 20 10:05:28 2016 +0000 +++ b/cube_crypto.h Thu Oct 20 13:13:46 2016 +0000 @@ -1,6 +1,6 @@ -#ifndef CUBE_CRYPTO_H -#define CUBE_CRYPTO_H +#ifndef __CUBE_CRYPTO_H__ +#define __CUBE_CRYPTO_H__ #include "mbed.h" #include <Timer.h> @@ -9,7 +9,7 @@ #include "mbedtls/cipher.h" #include "mbedtls/entropy.h" #include "mbedtls/ctr_drbg.h" - +#include "lib_CEBF746.h" #if DEBUG_LEVEL > 0 #include "mbedtls/debug.h" @@ -36,7 +36,8 @@ typedef struct { uint8_t cmd; - uint8_t data[16]; + //uint8_t data[16]; + uint8_t* data; uint16_t key_crc; } sec_spi_data; @@ -109,7 +110,9 @@ /* * AES crypto func */ - +spiDataStr getEncTxPacket(void); +spiDataStr getDecTxPacket(void); +uint8_t cube_get_status(void); bool cube_tpmkey_read(cube_sec_context *cube_ctx); bool cube_tpmkey_write(cube_sec_context *cube_ctx); void cube_sec_init(void); @@ -139,5 +142,4 @@ extern cube_sec_context Encrypt_ctx; extern cube_sec_context Decrypt_ctx; -#endif - +#endif /* __CUBE_CRYPTO_H__ */ \ No newline at end of file