Re: [pkix] How to select the ASN.1 structure of EC-SDSA (Schnorr signature with ECC)?

Michael StJohns <msj@nthpermutation.com> Mon, 22 August 2022 20:27 UTC

Return-Path: <msj@nthpermutation.com>
X-Original-To: pkix@ietfa.amsl.com
Delivered-To: pkix@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A4317C15271D for <pkix@ietfa.amsl.com>; Mon, 22 Aug 2022 13:27:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.906
X-Spam-Level:
X-Spam-Status: No, score=-6.906 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=nthpermutation-com.20210112.gappssmtp.com
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 Hw4ZLhtTBoGc for <pkix@ietfa.amsl.com>; Mon, 22 Aug 2022 13:27:48 -0700 (PDT)
Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 6DC77C15271C for <pkix@ietf.org>; Mon, 22 Aug 2022 13:27:48 -0700 (PDT)
Received: by mail-qv1-xf2c.google.com with SMTP id u6so4451328qvp.5 for <pkix@ietf.org>; Mon, 22 Aug 2022 13:27:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nthpermutation-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=QedCIpMpj5RSmSCDXZcu7Edxn9chOciC0WoHzH3fZ7g=; b=bMHkn6LF9uxk2dazXysUjvfl/v8WNEIB2qKLhUK167GJtesHk+g8Jw1uQGpDiLF9wq RqNcpC1khWqFgDq+P6cdWHFcoOP9+kvVkeajtee5q7qGkF38tporVxPs10tB5zQWFj84 XoCHvjH1PMK9KbvbbHjkRlaeUlLuxRYGsCimYaxnkGXBNt/HSGj2WTItys7IvDNp/cSe vA2bbOacslATxLyt+lfuqvUxHB//p6kjP+V+5BMapFA1SZk2sjYcwovTHPGmqm9W0cLh kl1O4UpmcFt5mEWPvCrfa/cC98rRT+iHPaLJHb6wWQL2m/q8QLZ90Curu0cGQqdXtArf 9CbA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=QedCIpMpj5RSmSCDXZcu7Edxn9chOciC0WoHzH3fZ7g=; b=B0lZ1r9Pd0tS+GBPrUBxNth6YNooPLBIXQ5STKBbqlfNGwVGMXseheFMzR18UBlL6Z YMUDAE2fB6QkL7pa2cBmeaXqpYPAIcFteAlK7T8gReet9dYZkt94a4je69KJQiG4b7+5 UD6flqi4w2TbTWHf+5Zvd0TwOJv53Ylu/+HdSr8CF/mdiTH/Smrht/jb9RqqXn+PxGHh +tiQmjXBs3AvV7yRxvTzzaOcd96/AGxNRSOGg4w4l/jh5OeUsof6JTiCK2GhdMyztLUx tCVNzIjii865r4Hle2CVpxUolxSYoz15Jivaeb2ofJ2Zyf/8J4vDFhxisT0953iqhLx3 W8WA==
X-Gm-Message-State: ACgBeo1cq/rzr4z6D/pifHMQ/BIgbFNWWHanlY5pUR28obf4+v5Tc33C gU/RQsF6lsnPFXg2nUrCqaY8ejkgwBo3lE2GITw=
X-Google-Smtp-Source: AA6agR5sSzQ6EAWQSWCreohml373mZCC8ywptxoJPGt2ShCCYH9gpap6RRWtqPZ9jP8W77rTtCJxww==
X-Received: by 2002:ad4:5bad:0:b0:476:e202:32eb with SMTP id 13-20020ad45bad000000b00476e20232ebmr17209829qvq.3.1661200065264; Mon, 22 Aug 2022 13:27:45 -0700 (PDT)
Received: from [192.168.1.23] (pool-108-31-156-76.washdc.fios.verizon.net. [108.31.156.76]) by smtp.gmail.com with ESMTPSA id cf17-20020a05622a401100b0034358bfc3c8sm9551819qtb.67.2022.08.22.13.27.44 for <pkix@ietf.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Aug 2022 13:27:44 -0700 (PDT)
Message-ID: <c8a0bbdb-0c76-cc4d-a153-e87632bec77d@nthpermutation.com>
Date: Mon, 22 Aug 2022 16:27:40 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0
Content-Language: en-US
To: pkix@ietf.org
References: <334707a8-7a3a-3d1d-2085-6b31b626f059@informatik.hu-berlin.de>
From: Michael StJohns <msj@nthpermutation.com>
In-Reply-To: <334707a8-7a3a-3d1d-2085-6b31b626f059@informatik.hu-berlin.de>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/pkix/NQGvKv9TNT9MgkDZpnplVnZ5FeY>
Subject: Re: [pkix] How to select the ASN.1 structure of EC-SDSA (Schnorr signature with ECC)?
X-BeenThere: pkix@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: PKIX Working Group <pkix.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/pkix>, <mailto:pkix-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/pkix/>
List-Post: <mailto:pkix@ietf.org>
List-Help: <mailto:pkix-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/pkix>, <mailto:pkix-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 22 Aug 2022 20:27:52 -0000

On 8/22/2022 3:04 PM, Ernst G Giessmann wrote:
> Hi folks,
> TLDR;
> is anywhere in PKIX the ASN1 format of the EC based Schnorr digital 
> signature algorithm EC-SDSA
> (aka https://oid-rep.orange-labs.fr/get/1.0.14888.3.0.13)
> defined?
>
AFAICT, not explicitly, but the German version of the spec 
https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Publications/TechGuidelines/TR03111/BSI-TR-03111_V-2-1_pdf.pdf?__blob=publicationFile&v=1 
suggests that the r field of a ECSDSA signature is still an integer, 
converted from the R value using the OS2I primitive on formation, and 
the I2OS primitive for verification.    That works for both the simple 
r||s and ASN1 encodings.

Mike


>
> This signature algo has the advantage, that it provides the full 
> strength of the hash function used, regardless of the strength (bit 
> length) of the underlying curve.
>
> Just to recall, it is defined as follows:
>
> Input:
>     base point G of an elliptic curve
>     privat key X (integer)
>     public key [X]∙G (point on the curve)
>     message to be signed M (octet string)
>
> Signing:
> (FE2BS is the straight-forward field element to bit string conversion, 
> and BS2I the conversion of a base 2 representation to an integer)
>     select a random integer K
>     compute the pre-signature P = [K]∙G (point on the curve)
>     witness R is computed as the hash of the x-coordinate PX of
>       point P concatenated with the message M:
>         R = h(FE2BS(PX) || M).
>     the second part S of the signature (R,S) is computed as
>         S = K + BS2I(R)X
>
> Verification:
>     recompute the pre-signature
>         P' = S∙G – BS2I(R)∙Y
>     recompute the witness
>         R' = h(FE2BS(P'X) || M)
>     accept if R = R'
>
> In contrast to EC-DSA, where the elements R and S of the signature are 
> both integers, we got here the full length (no truncation as for 
> EC-DSA) hash value as a bit string R and an integer S.
>
> So I guess that the ASN.1 structure for EC-SDSA should be defined as
>
> ECSDSA-Sig-Value ::= SEQUENCE {
>       r     BIT STRING,
>       s     INTEGER }
>
> Is that correct?
>
> Thanks for any suggestions
> /Ernst.
>
> _______________________________________________
> pkix mailing list
> pkix@ietf.org
> https://www.ietf.org/mailman/listinfo/pkix