[COSE] Help with RFC8152 encryption example

Anders Rundgren <anders.rundgren.net@gmail.com> Mon, 10 May 2021 09:24 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: cose@ietfa.amsl.com
Delivered-To: cose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2D7173A11AB for <cose@ietfa.amsl.com>; Mon, 10 May 2021 02:24:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 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, 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: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WGMywxrxALaP for <cose@ietfa.amsl.com>; Mon, 10 May 2021 02:24:24 -0700 (PDT)
Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6994E3A11A9 for <cose@ietf.org>; Mon, 10 May 2021 02:24:24 -0700 (PDT)
Received: by mail-wr1-x42c.google.com with SMTP id n2so15879535wrm.0 for <cose@ietf.org>; Mon, 10 May 2021 02:24:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=bQwOvNq+zMzwVsbvME5vi5xY5s4eQ8c/vu+e6uAaGLM=; b=nel6Nhv65QJhqpJdfr2cbewPNBR3aqBtbKS+6TrihG9JOvxcJAHhG9VDEX6P6d/RwS u33dhCNpRrThRsLM3oc3j1kaA8PBT0qJJkphJD5i+AGvBSfqb9w5Y1lALDs14bJ6Pp8X 2WZ9FNGEX639G1D1oUymEvcgOI3mGchTTV/aJru6OdS767/5M5eMyJesNdSW7pTt82cK AmRheXnLYiPHcihoF6oGaHOfmVjg9efsMRY/WaCRLGA09PXyledcaQdU/ZQi53qYEHNz fiAgL4cy19ODqXB6JwHh4Yn4Hoqpum09iyAEoPg6yDVRq2+2qq2QsN5431dKQLhQF8Uf xzWA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=bQwOvNq+zMzwVsbvME5vi5xY5s4eQ8c/vu+e6uAaGLM=; b=L0n5lOFbpJyZL13tDVO8LIpSbfMUODMm8QTRROYEFBBcwaqHLV7v+Y7kS8XlRvRR1r NGFzzSaiJCp9ty/MCyBBbvtaiS9JuQBy5A3UCXPe0u3/HIfdBLb4t3FfWcDyH9ODp7gY RoBATNp3HT1pHllx1AHL0Lgbuhcz12fbWzK0CW6S/bzFUTpTQ5Hy2uSH2z2D7G36M6If wYcM/P29jVEiAXz7FR3izFrNG9beOFPPn+pd68ddmsp90v7szwm46mIN9gJuJvwyVRPZ Q9kyD1J14bm1AHz2TCHnsw4Q0qG9XSsYLsSvdwHdsugT7csvMFfL4W73weGq5BywB7Zc YbYg==
X-Gm-Message-State: AOAM532KnNW5uSFDK2D0mJhu2DBptYcKDcw5CDq8tTyqQNEvNISRxcgo RtTCjPLBwcFO5gYOO++m3NDl/H2tA1gmSA==
X-Google-Smtp-Source: ABdhPJxD3pR+2DzD6vD4VtLM8sHLu1ZQoTH6cqyBAV2RwdvO4CLuK7lI7sSf4xtlB9xOmqUk3lOkQg==
X-Received: by 2002:adf:f00a:: with SMTP id j10mr28787807wro.231.1620638661180; Mon, 10 May 2021 02:24:21 -0700 (PDT)
Received: from [192.168.1.67] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id f20sm21029958wmh.41.2021.05.10.02.24.20 for <cose@ietf.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 May 2021 02:24:20 -0700 (PDT)
To: cose@ietf.org
From: Anders Rundgren <anders.rundgren.net@gmail.com>
Message-ID: <b9138e0c-a63f-bb15-11f1-b7c4519ebf2e@gmail.com>
Date: Mon, 10 May 2021 11:24:19 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/zeBMj4bu_OBmLXdaAg6EyPanIPE>
Subject: [COSE] Help with RFC8152 encryption example
X-BeenThere: cose@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cose>, <mailto:cose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose/>
List-Post: <mailto:cose@ietf.org>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cose>, <mailto:cose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 10 May 2021 09:24:29 -0000

Hi COSE gurus,

I took this simple sample:
https://datatracker.ietf.org/doc/html/rfc8152#appendix-C.4.1

and adjusted it to fit Carsten's http://cbor.me/

16(
      [
         {
             1:10
          } ,
        {
           5:h'89f52f65a1c580933b5261a78c'
        },
         h'5974e1b99a3a4cc09a659aa2e9e7fff161d38ce71cb45ce460ffb569'
      ]

It returns 51 bytes but the RFC says 52 bytes.

What am I doing wrong?

Thanx,
Anders