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 0C82A45BC0; Thu, 24 Oct 2024 15:30:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F265540281; Thu, 24 Oct 2024 15:30:34 +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 91BF340265 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-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-455-uwAyyW8ZPOizMGxbxbk-Fw-1; Thu, 24 Oct 2024 09:30:32 -0400 X-MC-Unique: uwAyyW8ZPOizMGxbxbk-Fw-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2fc95daca75so5820681fa.2 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=L1sQL4nJXcGgFlqQG3O2J/Fd+y2Hr3ZvK8se+RK4pgXQAkqXwXNXOpw8s9geEY1D3D CexjyCQbSDmdDaEacZaHwsmTwhl9nOz9MVfnVGRK4vf7j8OGjI9YxgUgAv4hEVFxHe1e Sr+A5JHCb7BskSnimRhzS8IIqfNbv69prbgY/rF+OBxJ65Rz8Na50G/nPel+Q2N3Y5VP N8Y7xcgir7x2XgNXntcdW9+FoN2NmICkU0TwKdNKNGVMVJgHWZO4ddrjgr121ILce+Z0 9To5r9BOqtyMRjOulGuiduG7R/BHsgWgtW2czMEmN9cMX/Hi9y87bJQSmxQuBfjlj+e0 oN8A== X-Gm-Message-State: AOJu0YxH7kopcpsPkhf6Eer3eB5pwyOMaleYZvZriUfhSTx1NkfOz94Z teh6XROJi6oytqs26fpYT4+aaCUwkUHTTDbIW9tp9XfM2rh0Swg/Jzw12L/Px+9FnGmS2c1jx9f x0kjyrnn5rJl5uMhl6Qp+QLa4A+IiMMgy5h02UDXaTMe2FdOQq6y3BmQLtcIhjl7m0qtQr0G49W 2/XmbtvCJ8eGzs4A0= X-Received: by 2002:a05:6512:b05:b0:539:f37f:bed9 with SMTP id 2adb3069b0e04-53b23dcc7c0mr1283651e87.8.1729776630393; 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: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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