* Helper routine to copy IV * Right now we support only algorithms with IV length equals 0/8/16 bytes. */
| 235 | * Right now we support only algorithms with IV length equals 0/8/16 bytes. |
| 236 | */ |
| 237 | static inline void |
| 238 | copy_iv(uint64_t dst[IPSEC_MAX_IV_QWORD], |
| 239 | const uint64_t src[IPSEC_MAX_IV_QWORD], uint32_t len) |
| 240 | { |
| 241 | RTE_BUILD_BUG_ON(IPSEC_MAX_IV_SIZE != 2 * sizeof(uint64_t)); |
| 242 | |
| 243 | switch (len) { |
| 244 | case IPSEC_MAX_IV_SIZE: |
| 245 | dst[1] = src[1]; |
| 246 | /* fallthrough */ |
| 247 | case sizeof(uint64_t): |
| 248 | dst[0] = src[0]; |
| 249 | /* fallthrough */ |
| 250 | case 0: |
| 251 | break; |
| 252 | default: |
| 253 | /* should never happen */ |
| 254 | RTE_ASSERT(NULL); |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | /* |
| 259 | * from RFC 4303 3.3.2.1.4: |
no outgoing calls
no test coverage detected