| 1976 | } |
| 1977 | |
| 1978 | static int |
| 1979 | check_iv_param(const struct rte_crypto_param_range *iv_range_size, |
| 1980 | unsigned int iv_param, int iv_random_size, |
| 1981 | uint16_t iv_length) |
| 1982 | { |
| 1983 | /* |
| 1984 | * Check if length of provided IV is supported |
| 1985 | * by the algorithm chosen. |
| 1986 | */ |
| 1987 | if (iv_param) { |
| 1988 | if (check_supported_size(iv_length, |
| 1989 | iv_range_size->min, |
| 1990 | iv_range_size->max, |
| 1991 | iv_range_size->increment) |
| 1992 | != 0) |
| 1993 | return -1; |
| 1994 | /* |
| 1995 | * Check if length of IV to be randomly generated |
| 1996 | * is supported by the algorithm chosen. |
| 1997 | */ |
| 1998 | } else if (iv_random_size != -1) { |
| 1999 | if (check_supported_size(iv_random_size, |
| 2000 | iv_range_size->min, |
| 2001 | iv_range_size->max, |
| 2002 | iv_range_size->increment) |
| 2003 | != 0) |
| 2004 | return -1; |
| 2005 | } |
| 2006 | |
| 2007 | return 0; |
| 2008 | } |
| 2009 | |
| 2010 | static int |
| 2011 | check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id) |
no test coverage detected