Convert remaining code to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99 integer types. This handles the remaining includes and kernel, plus touching up various points that we skipped because of include dependancies. We also convert the PRI printf formatters in the arch code over to normal formatters. Jira: ZEP-2051 Change-Id: Iecbb12601a3ee4ea936fd7ddea37788a645b08b0 Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
d9a1e367b2
commit
cc334c7273
132 changed files with 1420 additions and 1429 deletions
|
@ -105,7 +105,7 @@ static inline int cipher_begin_session(struct device *dev,
|
|||
enum cipher_op optype)
|
||||
{
|
||||
struct crypto_driver_api *api;
|
||||
uint32_t flags;
|
||||
u32_t flags;
|
||||
|
||||
api = (struct crypto_driver_api *) dev->driver_api;
|
||||
ctx->device = dev;
|
||||
|
@ -210,7 +210,7 @@ static inline int cipher_block_op(struct cipher_ctx *ctx,
|
|||
* @return 0 on success, negative errno code on fail.
|
||||
*/
|
||||
static inline int cipher_cbc_op(struct cipher_ctx *ctx,
|
||||
struct cipher_pkt *pkt, uint8_t *iv)
|
||||
struct cipher_pkt *pkt, u8_t *iv)
|
||||
{
|
||||
__ASSERT(ctx->ops.cipher_mode == CRYPTO_CIPHER_MODE_CBC, "CBC mode "
|
||||
"session invoking a different mode handler");
|
||||
|
@ -237,7 +237,7 @@ static inline int cipher_cbc_op(struct cipher_ctx *ctx,
|
|||
* @return 0 on success, negative errno code on fail.
|
||||
*/
|
||||
static inline int cipher_ctr_op(struct cipher_ctx *ctx,
|
||||
struct cipher_pkt *pkt, uint8_t *iv)
|
||||
struct cipher_pkt *pkt, u8_t *iv)
|
||||
{
|
||||
__ASSERT(ctx->ops.cipher_mode == CRYPTO_CIPHER_MODE_CTR, "CTR mode "
|
||||
"session invoking a different mode handler");
|
||||
|
@ -259,7 +259,7 @@ static inline int cipher_ctr_op(struct cipher_ctx *ctx,
|
|||
* @return 0 on success, negative errno code on fail.
|
||||
*/
|
||||
static inline int cipher_ccm_op(struct cipher_ctx *ctx,
|
||||
struct cipher_aead_pkt *pkt, uint8_t *nonce)
|
||||
struct cipher_aead_pkt *pkt, u8_t *nonce)
|
||||
{
|
||||
__ASSERT(ctx->ops.cipher_mode == CRYPTO_CIPHER_MODE_CCM, "CCM mode "
|
||||
"session invoking a different mode handler");
|
||||
|
|
|
@ -51,13 +51,13 @@ typedef int (*block_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt);
|
|||
* like CBC, CTR, CCM.
|
||||
*/
|
||||
typedef int (*cbc_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt,
|
||||
uint8_t *iv);
|
||||
u8_t *iv);
|
||||
|
||||
typedef int (*ctr_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt,
|
||||
uint8_t *ctr);
|
||||
u8_t *ctr);
|
||||
|
||||
typedef int (*ccm_op_t)(struct cipher_ctx *ctx, struct cipher_aead_pkt *pkt,
|
||||
uint8_t *nonce);
|
||||
u8_t *nonce);
|
||||
|
||||
struct cipher_ops {
|
||||
|
||||
|
@ -72,15 +72,15 @@ struct cipher_ops {
|
|||
};
|
||||
|
||||
struct ccm_params {
|
||||
uint16_t tag_len;
|
||||
uint16_t nonce_len;
|
||||
u16_t tag_len;
|
||||
u16_t nonce_len;
|
||||
};
|
||||
|
||||
struct ctr_params {
|
||||
/* CTR mode counter is a split counter composed of iv and counter
|
||||
* such that ivlen + ctr_len = keylen
|
||||
*/
|
||||
uint32_t ctr_len;
|
||||
u32_t ctr_len;
|
||||
};
|
||||
|
||||
/* Structure encoding session parameters. Refer to comments for individual
|
||||
|
@ -98,7 +98,7 @@ struct cipher_ctx {
|
|||
/* To be populated by the app before calling begin_session() */
|
||||
union {
|
||||
/* Cryptographic key to be used in this session */
|
||||
uint8_t *bit_stream;
|
||||
u8_t *bit_stream;
|
||||
/* For cases where key is protected and is not
|
||||
* available to caller
|
||||
*/
|
||||
|
@ -140,7 +140,7 @@ struct cipher_ctx {
|
|||
/* Cryptographic keylength in bytes. To be populated by the app
|
||||
* before calling begin_session()
|
||||
*/
|
||||
uint16_t keylen;
|
||||
u16_t keylen;
|
||||
|
||||
|
||||
/* How certain fields are to be interpreted for this sesssion.
|
||||
|
@ -148,7 +148,7 @@ struct cipher_ctx {
|
|||
* An app can obtain the capability flags supported by a hw/driver
|
||||
* by calling cipher_query_hwcaps(). (A bitmask of CAP_* below)
|
||||
*/
|
||||
uint16_t flags;
|
||||
u16_t flags;
|
||||
};
|
||||
|
||||
/* Various cipher_ctx.flags options. Not all drivers support all flags.
|
||||
|
@ -186,7 +186,7 @@ struct cipher_ctx {
|
|||
struct cipher_pkt {
|
||||
|
||||
/* Start address of Input buffer */
|
||||
uint8_t *in_buf;
|
||||
u8_t *in_buf;
|
||||
|
||||
/* Bytes to be operated upon */
|
||||
int in_len;
|
||||
|
@ -195,7 +195,7 @@ struct cipher_pkt {
|
|||
* the application. Can be NULL for in place ops. To be populated
|
||||
* with contents by the driver on return from op / async_callback
|
||||
*/
|
||||
uint8_t *out_buf;
|
||||
u8_t *out_buf;
|
||||
|
||||
/* Size of the out_buf area allocated by the application. Drivers should
|
||||
* not write past the size of output buffer
|
||||
|
@ -212,7 +212,7 @@ struct cipher_pkt {
|
|||
* returns a first level success / failure status. To be populated
|
||||
* by the driver on return from op / async_callback.
|
||||
*/
|
||||
uint8_t status;
|
||||
u8_t status;
|
||||
|
||||
/* Context this packet relates to. This can be useful to get the
|
||||
* session details esp for async ops. Will be populated by the
|
||||
|
@ -230,16 +230,16 @@ struct cipher_aead_pkt {
|
|||
struct cipher_pkt *pkt;
|
||||
|
||||
/* Start address for Associated data. This has to be supplied by app */
|
||||
uint8_t *ad;
|
||||
u8_t *ad;
|
||||
|
||||
/* Size of Associated data. This has to be supplied by the app */
|
||||
uint32_t ad_len;
|
||||
u32_t ad_len;
|
||||
|
||||
/* Start address for the Auth hash. For an Encryption op this will
|
||||
* be populated by the driver when it returns from cipher_ccm_op call.
|
||||
* For a decryption op this has to be supplied by the app.
|
||||
*/
|
||||
uint8_t *tag;
|
||||
u8_t *tag;
|
||||
};
|
||||
|
||||
/* Prototype for the application function to be invoked by the crypto driver
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue