Re: [jose] RFC 8037 "alg" quirkiness

Anders Rundgren <> Sun, 20 September 2020 06:25 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id D56E43A0BE3 for <>; Sat, 19 Sep 2020 23:25:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Status: No, score=-2.099 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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id HbHYTqCxhpg5 for <>; Sat, 19 Sep 2020 23:25:02 -0700 (PDT)
Received: from ( [IPv6:2a00:1450:4864:20::332]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 143533A0BDE for <>; Sat, 19 Sep 2020 23:25:02 -0700 (PDT)
Received: by with SMTP id b79so9392367wmb.4 for <>; Sat, 19 Sep 2020 23:25:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=fO+CXFDI9LlGajIFK0S5ZE2zgnmFqqJfNowfo0jVgQ4=; b=d7WG3saLwXlcUZqnFMxuZLyMADPX41ySbBKggjN4m83nXkMd+KAI6TXH8SkkG7awkD F1B6P09jYf2ndk307oghYJOU7MyXbBz66OZxUxGglNiz5r7vsyZVipbQB2EaiUmmhabP thjGHP9RUf9h0uXkCIaxZbMGJIpeGcPiygQs5PCHJz9WsSyJYMf4gEbllK/zA+AL8eo9 bkdt8OEU5/p8Q7ZCdfkqFy2wuct6hZMaqSU7S/HiDMCUftsKX83/YhoHioAig9+UEUPa 3ze01V2FFXxzheDEmWe1RZGVdWjFME5FN9/egaFB619F73uUehnJRsOI+dmcH5i6a3Aq TlHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fO+CXFDI9LlGajIFK0S5ZE2zgnmFqqJfNowfo0jVgQ4=; b=DHwTmfM20mrevyM25TocLXEdI6M5Ohk2D7ZFKYLcwmOk3EKVpi+qfe6smLcib4ZSDj vqyM+NDJDlFkx4aXqKcVyQ753KOMHSoh+fjE9Sebr20xWC6GbKSp4deKt/ov8hzFVOCp qcFJQMp1CZwCav2EqZigVq0IE12uyMHqw/SIAtkFItnXEAxYvJ6ns4NX81YbWqjE0hvh epdrXdHSZkNAWNHKqQ9I7HQ/Iixyuzrjg/GGtsf63LpalwLvFvouywzoZtvzHVDQvo+D RBqlAjFfrIsZTPd+IbfbddBKRtn1PPraPFRuhXb6u2AI+AV6fXVWYonnpJZH+IIguejl SXrA==
X-Gm-Message-State: AOAM533AtoRvoILcA2PPj1ffRzIY8RYLMcxU0C1tv58LMrLzvR0M71n5 r2Gw/DRE1dObhk9Ix7KXMpHoC7BvcPfvDw==
X-Google-Smtp-Source: ABdhPJzJcPC2WMON20ifxNm2YvEL5uOowcdbkbf7O5j9ILP8av8+F/Dp5tgQUmlDwLOlJ71Py3w3Kg==
X-Received: by 2002:a1c:3505:: with SMTP id c5mr25247127wma.65.1600583099964; Sat, 19 Sep 2020 23:24:59 -0700 (PDT)
Received: from [] ( []) by with ESMTPSA id q13sm15175014wra.93.2020. (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Sep 2020 23:24:58 -0700 (PDT)
To: Jim Schaad <>,
References: <> <039901d68ed6$2ed27ba0$8c7772e0$>
From: Anders Rundgren <>
Message-ID: <>
Date: Sun, 20 Sep 2020 08:24:56 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0
MIME-Version: 1.0
In-Reply-To: <039901d68ed6$2ed27ba0$8c7772e0$>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <>
Subject: Re: [jose] RFC 8037 "alg" quirkiness
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Javascript Object Signing and Encryption <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Sun, 20 Sep 2020 06:25:04 -0000

On 2020-09-20 00:42, Jim Schaad wrote:
> Jumping back to the start.

It seems that your mail system generates duplicates.

FWIW, here is how the quirk manifests itself in my JOSE library:

     JSONObjectWriter setSignatureAlgorithm(JSONObjectWriter joseObject,
                                            SignatureAlgorithms signatureAlgorithm) {
         return joseObject.setString("alg",
                                     signatureAlgorithm.isOkp() ?
              "EdDSA" : signatureAlgorithm.getAlgorithmId());

Presumably few cryptographic API's accept "EdDSA" as a signature algorithm.

You could indeed have used "EdDSA" as signature algorithm in RFC 8410 but
you did not and IMO you did the right choice.

Anyway, navigating in crypto-land is often a bit challenging:

I've made my point, nothing more to add on my side :)


> -----Original Message-----
> From: jose <> On Behalf Of Anders Rundgren
> Sent: Saturday, August 29, 2020 11:58 PM
> To:
> Subject: [jose] RFC 8037 "alg" quirkiness
> I have just implemented support for Edwards curves in my JSON library.
> Although it is certainly not a deal-breaker I find the use of "EdDSA" as a
> generic Edwards algorithm identifier rather quirky since it departs from the
> other JWS algorithms:
> [JLS]  I do not find this at all in consistent with the way that the other
> signature algorithms were handled, but that may just be me.  For the ECDSA
> algorithms, the size of the hash is specified because it could be variable
> across the different curve sizes.  So you can do ECDSA with SHA-512 and
> P-256.  The requirement to specify the hash was needed to bring the number
> of options down to just those that are fixed by the curve.
> [JLS] For EdDSA, the hash function is fixed by the curve.  This would change
> if different hash functions where allowed for the same curve but I do not
> believe that this where ever be in danger of happening because it was
> strongly argued that a single hash function was the correct approach.  Since
> there was not a need to specify the hash function independent of the key,
> there was no need to specify an EdDSA with SHA-512 and an EdDSA with
> SHAKE-256 it was not done.
> Jim
> For curiosity reasons I took a peek at the initial draft which has (in my
> opinion...) a more logical solution:
> May I ask why this change was performed?
> For JSF (JSON Signature Format) I will stick to the "00" scheme which also
> permits use of ed25519ph and friends if needed:
> thanx,
> Anders
> _______________________________________________
> jose mailing list