2 * Copyright (C) 2016 Cavium, Inc.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License
6 * as published by the Free Software Foundation.
10 #define _CPTVF_ALGS_H_
12 #include "request_manager.h"
14 #define MAX_DEVICES 16
15 #define MAJOR_OP_FC 0x33
16 #define MAX_ENC_KEY_SIZE 32
17 #define MAX_HASH_KEY_SIZE 64
18 #define MAX_KEY_SIZE (MAX_ENC_KEY_SIZE + MAX_HASH_KEY_SIZE)
19 #define CONTROL_WORD_LEN 8
20 #define KEY2_OFFSET 48
22 #define DMA_MODE_FLAG(dma_mode) \
23 (((dma_mode) == DMA_GATHER_SCATTER) ? (1 << 7) : 0)
50 #if defined(__BIG_ENDIAN_BITFIELD)
57 u64 auth_input_type
:1;
69 u64 auth_input_type
:1;
86 union encr_ctrl enc_ctrl
;
91 struct fchmac_context
{
93 u8 opad
[64]; /* or OPAD */
97 struct enc_context enc
;
98 struct fchmac_context hmac
;
103 u8 enc_key
[MAX_KEY_SIZE
];
108 struct cvm_des3_ctx
{
110 u8 des3_key
[MAX_KEY_SIZE
];
114 struct cpt_request_info cpt_req
;
116 struct fc_context fctx
;
119 int cptvf_do_request(void *cptvf
, struct cpt_request_info
*req
);
120 #endif /*_CPTVF_ALGS_H_*/