blob: ecdddb640d01d860e7390d6f6ec33d87af698a9e [file] [log] [blame]
/*
* Copyright (c) 2017, Linaro Limited
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __AES_TA_H__
#define __AES_TA_H__
/* UUID of the AES example trusted application */
#define TA_AES_UUID \
{ 0x5dbac793, 0xf574, 0x4871, \
{ 0x8a, 0xd3, 0x04, 0x33, 0x1e, 0xc1, 0x7f, 0x24 } }
/*
* TA_AES_CMD_PREPARE - Allocate resources for the AES ciphering
* param[0] (value) a: TA_AES_ALGO_xxx, b: unused
* param[1] (value) a: key size in bytes, b: unused
* param[2] (value) a: TA_AES_MODE_ENCODE/_DECODE, b: unused
* param[3] unused
*/
#define TA_AES_CMD_PREPARE 0
#define TA_AES_ALGO_ECB 0
#define TA_AES_ALGO_CBC 1
#define TA_AES_ALGO_CTR 2
#define TA_AES_SIZE_128BIT (128 / 8)
#define TA_AES_SIZE_256BIT (256 / 8)
#define TA_AES_MODE_ENCODE 1
#define TA_AES_MODE_DECODE 0
/*
* TA_AES_CMD_SET_KEY - Allocate resources for the AES ciphering
* param[0] (memref) key data, size shall equal key length
* param[1] unused
* param[2] unused
* param[3] unused
*/
#define TA_AES_CMD_SET_KEY 1
/*
* TA_AES_CMD_SET_IV - reset IV
* param[0] (memref) initial vector, size shall equal key length
* param[1] unused
* param[2] unused
* param[3] unused
*/
#define TA_AES_CMD_SET_IV 2
/*
* TA_AES_CMD_CIPHER - Ciphere inut buffer into output buffer
* param[0] (memref) input buffer
* param[1] (memref) output buffer (shall be bigger than input buffer)
* param[2] unused
* param[3] unused
*/
#define TA_AES_CMD_CIPHER 3
#endif /* __AES_TA_H */