X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fcommon%2Fcnxk%2Froc_se.h;h=c565ec1b741405873820ce92ec4dcb7977831ef0;hb=5242d8dbbed7fa78c01e86777a4cbc96f5605372;hp=a1d476a86de7bce33cb7fd0c2b94ba4b6abaac28;hpb=013b4c52c708dc8fed079ff05fbe66f475365586;p=dpdk.git diff --git a/drivers/common/cnxk/roc_se.h b/drivers/common/cnxk/roc_se.h index a1d476a86d..c565ec1b74 100644 --- a/drivers/common/cnxk/roc_se.h +++ b/drivers/common/cnxk/roc_se.h @@ -301,6 +301,27 @@ struct roc_se_ctx { uint8_t *auth_key; }; +static inline void +roc_se_zuc_bytes_swap(uint8_t *arr, int len) +{ + int start, end; + uint8_t tmp; + + if (len <= 0) + return; + + start = 0; + end = len - 1; + + while (start < end) { + tmp = arr[start]; + arr[start] = arr[end]; + arr[end] = tmp; + start++; + end--; + } +} + int __roc_api roc_se_auth_key_set(struct roc_se_ctx *se_ctx, roc_se_auth_type type, const uint8_t *key, uint16_t key_len, uint16_t mac_len); @@ -310,4 +331,5 @@ int __roc_api roc_se_ciph_key_set(struct roc_se_ctx *se_ctx, uint16_t key_len, uint8_t *salt); void __roc_api roc_se_ctx_swap(struct roc_se_ctx *se_ctx); + #endif /* __ROC_SE_H__ */