Dmitry Eremin-Solenikov(lumag) replied on github web page: platform/linux-generic/odp_crypto.c line 57 @@ -308,6 +319,142 @@ void packet_hmac(odp_packet_t pkt, HMAC_Final(ctx, hash, NULL); } +static void do_pad_xor(uint8_t *out, const uint8_t *in, int len) { + int pos=0; + for (pos=1; pos <= 16; pos++, in++, out++) { + if (pos <= len) + *out ^= *in; + if (pos > len) { + *out ^= 0x80; + break; + } + } +} +static void xor_block(aes_block res, const aes_block op) { + res[0] ^= op[0]; + res[1] ^= op[1]; + res[2] ^= op[2]; + res[3] ^= op[3]; +} + +static +odp_crypto_alg_err_t aesxcbc_gen(odp_packet_t pkt, + const odp_crypto_packet_op_param_t *param, + odp_crypto_generic_session_t *session) +{ + aes_block e = {0, 0, 0, 0}; + uint8_t *data = odp_packet_data(pkt);
Comment: odp_packet_offset to loop through the packet. > SonicwallYhe wrote > I am not very clear about here. So which api I should use? >> Dmitry Eremin-Solenikov(lumag) wrote: >> `EVP_aes_128_ecb()` should become a parameter here that is stored as >> `session->auth.evp_cipher`. >>> Dmitry Eremin-Solenikov(lumag) wrote: >>> You also need to set auth.init func here. For now you can use nullinit >>> function >>>> Dmitry Eremin-Solenikov(lumag) wrote: >>>> XCBC-MAC computation should be extracted to a separate function. >>>>> Dmitry Eremin-Solenikov(lumag) wrote: >>>>> This will not work with segmented packets. >>>>>> Dmitry Eremin-Solenikov(lumag) wrote: >>>>>> Please use `uint32_t*` instead of adding new type. https://github.com/Linaro/odp/pull/470#discussion_r167884205 updated_at 2018-02-13 14:43:16