Re: [CFRG] [Technical Errata Reported] RFC7748 (7879)

Mike Hamburg <mike@shiftleft.org> Tue, 02 April 2024 21:43 UTC

Return-Path: <mike@shiftleft.org>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8DF4AC151076; Tue, 2 Apr 2024 14:43:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.095
X-Spam-Level:
X-Spam-Status: No, score=-2.095 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=shiftleft.org
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L5BYwpa2If9I; Tue, 2 Apr 2024 14:43:06 -0700 (PDT)
Received: from wanderer.shiftleft.org (wanderer.shiftleft.org [IPv6:2600:3c01::f03c:92ff:fec5:c23c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0D8A8C1D61F5; Tue, 2 Apr 2024 14:42:42 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: mike) by wanderer.shiftleft.org (Postfix) with ESMTPSA id 22547444B2; Tue, 2 Apr 2024 21:42:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shiftleft.org; s=sldo; t=1712094161; bh=ogNhCdyTO3sjRUC0iXSCyt4GpOk02xHVghPDtlDg024=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=BcVJyFEjfxEMqjeOUKW1EhVnlvcje8zb62bLr8Er7zC17VK7IAGWuB6ap14YfU2it iskDgPCKqSq6Jh1wrJYGXHk3QdJMyHzpC6rZ8vFVaCYN+tNHyzaVXOBlqM8xbnyncu Bb0vaKciA3luAPNX71evSN50Q5as/pB9DEfDGhWE=
Content-Type: multipart/alternative; boundary="Apple-Mail-D7C2D9BF-D685-4180-BDB7-6C2769151900"
Content-Transfer-Encoding: 7bit
From: Mike Hamburg <mike@shiftleft.org>
Mime-Version: 1.0 (1.0)
Date: Tue, 02 Apr 2024 17:42:28 -0400
Message-Id: <62303774-46EF-4BBB-A4C4-9E6B59B2C48F@shiftleft.org>
References: <20240402202257.9242D18FFDB3@rfcpa.amsl.com>
Cc: agl@google.com, sean@sn3rd.com, irsg@irtf.org, cfrg@irtf.org, nawrashussein2@gmail.com
In-Reply-To: <20240402202257.9242D18FFDB3@rfcpa.amsl.com>
To: RFC Errata System <rfc-editor@rfc-editor.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/1kNqmhwFrBkSAVMvAtuKe6yFU4U>
Subject: Re: [CFRG] [Technical Errata Reported] RFC7748 (7879)
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://mailman.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://mailman.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Tue, 02 Apr 2024 21:43:11 -0000

Hello Nawras,

Thanks for reporting this. The calculation can be done with either AA setting “a24” = (A-2)/4, or with BB setting “a24” = (A+2)/4.  Both calculations appear in the literature.  We happened to follow the Curve25519 paper instead of the original Montgomery paper when making the RFC.

See eg https://crypto.stackexchange.com/questions/67942/difference-on-montgomery-curve-equation-between-efd-and-rfc7748

Regards,
— Mike

> On Apr 2, 2024, at 16:22, RFC Errata System <rfc-editor@rfc-editor.org> wrote:
> 
> The following errata report has been submitted for RFC7748,
> "Elliptic Curves for Security".
> 
> --------------------------------------
> You may review the report below and at:
> https://www.rfc-editor.org/errata/eid7879
> 
> --------------------------------------
> Type: Technical
> Reported by: Nawras Hussein Sabbry <nawrashussein2@gmail.com>
> 
> Section: 5
> 
> Original Text
> -------------
> z_2 = E * (AA + a24 * E)
> 
> Corrected Text
> --------------
> z_2 = E * (BB + a24 * E)
> 
> Notes
> -----
> In the for loop on page 8, the variable AA should be replaced with BB in Z_2. This modification is necessary because the mathematical formula for point doubling on the Montgomery curve according to (https://en.wikipedia.org/wiki/Montgomery_curve#Montgomery_arithmetic) indicates that Z2n (equivalent to Z_2 in this case) is calculated as follows: Z2n = 4XnZn((Xn-Zn)^2 + ((A+2)/4)(4XnZn)). It is observed in this equation that the operation in the (Xn-Zn)^2 part involves subtraction similar to the variable B, while the operation in the variable A involves addition. Considering this discrepancy, it is suggested to substitute AA with BB for correctness.
> 
> Instructions:
> -------------
> This erratum is currently posted as "Reported". (If it is spam, it
> will be removed shortly by the RFC Production Center.) Please
> use "Reply All" to discuss whether it should be verified or
> rejected. When a decision is reached, the verifying party  
> will log in to change the status and edit the report, if necessary.
> 
> --------------------------------------
> RFC7748 (draft-irtf-cfrg-curves-11)
> --------------------------------------
> Title               : Elliptic Curves for Security
> Publication Date    : January 2016
> Author(s)           : A. Langley, M. Hamburg, S. Turner
> Category            : INFORMATIONAL
> Source              : Crypto Forum Research Group
> Stream              : IRTF
> Verifying Party     : IRSG