1 /*- 2 * BSD LICENSE 3 * 4 * Copyright(c) 2015-2016 Intel Corporation. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 10 * * Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * * Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in 14 * the documentation and/or other materials provided with the 15 * distribution. 16 * * Neither the name of Intel Corporation nor the names of its 17 * contributors may be used to endorse or promote products derived 18 * from this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 #ifndef TEST_CRYPTODEV_H_ 33 #define TEST_CRYPTODEV_H_ 34 35 #define HEX_DUMP 0 36 37 #define FALSE 0 38 #define TRUE 1 39 40 #define MAX_NUM_OPS_INFLIGHT (4096) 41 #define MIN_NUM_OPS_INFLIGHT (128) 42 #define DEFAULT_NUM_OPS_INFLIGHT (128) 43 44 #define MAX_NUM_QPS_PER_QAT_DEVICE (2) 45 #define DEFAULT_NUM_QPS_PER_QAT_DEVICE (2) 46 #define DEFAULT_BURST_SIZE (64) 47 #define DEFAULT_NUM_XFORMS (2) 48 #define NUM_MBUFS (8191) 49 #define MBUF_CACHE_SIZE (256) 50 #define MBUF_DATAPAYLOAD_SIZE (2048 + DIGEST_BYTE_LENGTH_SHA512) 51 #define MBUF_SIZE (sizeof(struct rte_mbuf) + \ 52 RTE_PKTMBUF_HEADROOM + MBUF_DATAPAYLOAD_SIZE) 53 54 #define BYTE_LENGTH(x) (x/8) 55 /* HASH DIGEST LENGTHS */ 56 #define DIGEST_BYTE_LENGTH_MD5 (BYTE_LENGTH(128)) 57 #define DIGEST_BYTE_LENGTH_SHA1 (BYTE_LENGTH(160)) 58 #define DIGEST_BYTE_LENGTH_SHA224 (BYTE_LENGTH(224)) 59 #define DIGEST_BYTE_LENGTH_SHA256 (BYTE_LENGTH(256)) 60 #define DIGEST_BYTE_LENGTH_SHA384 (BYTE_LENGTH(384)) 61 #define DIGEST_BYTE_LENGTH_SHA512 (BYTE_LENGTH(512)) 62 #define DIGEST_BYTE_LENGTH_AES_XCBC (BYTE_LENGTH(96)) 63 #define DIGEST_BYTE_LENGTH_SNOW3G_UIA2 (BYTE_LENGTH(32)) 64 #define DIGEST_BYTE_LENGTH_KASUMI_F9 (BYTE_LENGTH(32)) 65 #define AES_XCBC_MAC_KEY_SZ (16) 66 #define DIGEST_BYTE_LENGTH_AES_GCM (BYTE_LENGTH(128)) 67 68 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA1 (12) 69 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA224 (16) 70 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA256 (16) 71 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA384 (24) 72 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA512 (32) 73 74 #endif /* TEST_CRYPTODEV_H_ */ 75