From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 19D7945BC0 for ; Thu, 24 Oct 2024 15:30:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E8F843493; Thu, 24 Oct 2024 15:30:36 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id C61FD40281 for ; Thu, 24 Oct 2024 15:30:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729776633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PLI5XmbZDuapjRsIetSqcTNWYfIN4dGNO64LDz7W6bk=; b=ZSnHsB226wEB7b9dIpiQu3FYPbhzKLhcHj1O0RZ1gATZ6ghjpxL5loaAA6415489tTF/jP E7hhve4Fi+Dt0zXZdslLHHLxzWtlifOiIQyBKDcgKkFR2Xvfp4z/wzSMZXOIavd1Ehp31E UD+ow4W82yIcBoXxkyLFbsxWfYwDr8c= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-135-fQpKz1cvOGq60lUj2lUOOg-1; Thu, 24 Oct 2024 09:30:32 -0400 X-MC-Unique: fQpKz1cvOGq60lUj2lUOOg-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-539eb3416cdso708397e87.1 for ; Thu, 24 Oct 2024 06:30:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729776630; x=1730381430; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PLI5XmbZDuapjRsIetSqcTNWYfIN4dGNO64LDz7W6bk=; b=iLiWQeX9/BR9OQmUiGpY8DtYLmNqX0hLOwdgc3syIwhXCf7Xk6qS7bnOCehe+w5RIE 3aHuhkEA6vOYzFE5iHG9eS+IJ5m2MOdTYDxC0Rj0XVZk999i0sAGjEcgt9Uv0GmUNxYL lRbW5UUD39QBQ9/dUpTIsOMCOivu0t4QAKtF2iKLPx3OcSFIM+pc/bGZYr9UvVujfEfj /oK2djB/3dZTgKUOHyTJHaXzHofj48SAla+4AsNG6sLrNcbncohIJSIPapMaBp/BhFQW KK0+wI9l3+JXPZlrsslHv3bpmlL11sgK1NdCneFCwyCQbBGgGjALONyXBh7Cqm2s+vGJ YcOA== X-Forwarded-Encrypted: i=1; AJvYcCWttHWyr9pC+R+B2vPrvmKRNl0Vwb7uoqXmPRB3mgSnlWmcQ7uY26F0HuagJXrHY6LjiCHIQAY=@dpdk.org X-Gm-Message-State: AOJu0YyGWliBO3ZEHKkqMfFfRDOMFlALqCih70Ab+xd6ebEDqIv2xaV7 on/IQdBo5Y2UJCWHk1hxYbdllZNiGBUC3TtAek+KFZLaCRlKnmKDdTDcbQbCqefy9khnwJ7ZAF9 fmj+msqEcLosfG+0/xATvJqJyIB5VOCrN922lE0OFKE5gvmcERFLBQDN74pEnmuyES5n+UiElYH BOTmOyr4ndpHQGt6UuXsY= X-Received: by 2002:a05:6512:b05:b0:539:f37f:bed9 with SMTP id 2adb3069b0e04-53b23dcc7c0mr1283654e87.8.1729776630395; Thu, 24 Oct 2024 06:30:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6+f8o/1n2nUJcMYjDoYxM+Ry7zC2Rjks0Cqy+BFLoborSOCRtIOXJGD2HZ+aPNjMBjzOA6FPwcqE413gLUwM= X-Received: by 2002:a05:6512:b05:b0:539:f37f:bed9 with SMTP id 2adb3069b0e04-53b23dcc7c0mr1283632e87.8.1729776629982; Thu, 24 Oct 2024 06:30:29 -0700 (PDT) MIME-Version: 1.0 References: <20241024120535.2722316-1-david.marchand@redhat.com> <20241024120535.2722316-5-david.marchand@redhat.com> <98CBD80474FA8B44BF855DF32C47DC35E9F816@smartserver.smartshare.dk> In-Reply-To: From: David Marchand Date: Thu, 24 Oct 2024 15:30:18 +0200 Message-ID: Subject: Re: [PATCH 4/6] crypto/openssl: fix 3DES-CTR with big endian CPUs To: =?UTF-8?Q?Morten_Br=C3=B8rup?= Cc: dev@dpdk.org, thomas@monjalon.net, ferruh.yigit@amd.com, stephen@networkplumber.org, mattias.ronnblom@ericsson.com, stable@dpdk.org, Kai Ji , Slawomir Mrozowicz , Tomasz Kulasek , Daniel Mrzyglod , Pablo de Lara , Michal Kobylinski X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Thu, Oct 24, 2024 at 3:17=E2=80=AFPM David Marchand wrote: > @@ -1209,14 +1195,16 @@ process_openssl_cipher_des3ctr(struct rte_mbuf > *mbuf_src, uint8_t *dst, > l =3D rte_pktmbuf_data_len(m) - offset; > > memcpy(ctr, iv, 8); > + host_ctr =3D rte_be_64_to_cpu(ctr); > > for (n =3D 0; n < srclen; n++) { > if (n % 8 =3D=3D 0) { > + ctr =3D rte_cpu_to_be_64(host_ctr); Moving this here adds one uneeded extra conversion on the first iteration. So I would keep the conversion around the host_ctr variable increment, if you get the idea. > if (EVP_EncryptUpdate(ctx, > (unsigned char *)&ebuf, &unused, > (const unsigned char *)&ctr, 8) <= =3D 0) > goto process_cipher_des3ctr_err; > - ctr_inc(ctr); > + host_ctr++; > } > dst[n] =3D *(src++) ^ ebuf[n % 8]; --=20 David Marchand