Re: aes128gcm: is the 1st example wrong?

Martin Thomson <martin.thomson@gmail.com> Mon, 13 February 2017 09:57 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 37342129566 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 13 Feb 2017 01:57:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.501
X-Spam-Level:
X-Spam-Status: No, score=-6.501 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_SORBS_SPAM=0.5, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-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 gejtIdDTIyol for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 13 Feb 2017 01:57:15 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2C9991293FD for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 13 Feb 2017 01:57:14 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1cdCTy-0006n7-HG for ietf-http-wg-dist@listhub.w3.org; Mon, 13 Feb 2017 08:59:38 +0000
Resent-Date: Mon, 13 Feb 2017 08:59:38 +0000
Resent-Message-Id: <E1cdCTy-0006n7-HG@frink.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by frink.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <martin.thomson@gmail.com>) id 1cdCTu-0006mL-GY for ietf-http-wg@listhub.w3.org; Mon, 13 Feb 2017 08:59:34 +0000
Received: from mail-qk0-f193.google.com ([209.85.220.193]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <martin.thomson@gmail.com>) id 1cdCTo-0002ss-8g for ietf-http-wg@w3.org; Mon, 13 Feb 2017 08:59:28 +0000
Received: by mail-qk0-f193.google.com with SMTP id 11so13680736qkl.0 for <ietf-http-wg@w3.org>; Mon, 13 Feb 2017 00:59:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=M1g3IDQXGK/VpEysb5qH2sZqVi0joj/U3MMOkkwwwvw=; b=p+2XVwkLroLvxbPWOka41iP9NcJg/PT7NLFpOBB67Z7aAYdDenVWFLxwPFWv4COSaQ uH0xYTqynfNYHA246A8ifh9eVKABlNgM9wuA9JY8XLjG3z1/YgP7oue70NoKLu491yHo cVTh4IWtli220oNmlHn0WIVM3XiXgJQ3AAxJ3n7c+qk0xM0sMCzNM+ipeyCKA/EfV//7 1PIzpHpMLMHf/DJGgQLdI+aeRRcBuDvQZde4yqQ3ng2scKsA4RtDsK9v84VGAtXebhTg umpbusNGAYY+BlmpEnbfqyCR5dNgTRJ1xNhQYy0bWNSVGxNv27Gsqzqd9LtGXyLKEeR9 YY/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=M1g3IDQXGK/VpEysb5qH2sZqVi0joj/U3MMOkkwwwvw=; b=PsY4dH3Qk4N1Vm57KQu2CS/IE6417ry3mCUa5M/kT/wk0GpICIql/JtFjA1F+A3qOs FHeQy5eh0VaeEn4hVFA5rJ+UQq9YKKeYJW0ZDdIHFf/b53EaEbxFJrhJ2zezMCzr6htX 7MVA3Y8bhsRqzsTYkv/V4e8/+hAv4cGEiDTKfJHnmpeOMclAF7vkaN2Uq+5sFFrs6ZhP qH1b2L55aqHp2J94Lw1jEyEZzUdGE4lgDcEyhMIrHJLm/0QHTXpH5wtEr4vzOlOdyqtW DPmlpLrbWc6QLhNpc9zJVKCrRkGEJ7tLs/lsig9ZQDcBkiXsf3UkyvZX4GZnarvLEB59 Srrg==
X-Gm-Message-State: AMke39lt4y5u47VcJUJhYcAQgdbUcj/P0NTI+ze60qp1DDpS3qHjpoui+yI+kFEKwQpUEz+RjLjPLJFpIvSefA==
X-Received: by 10.55.151.7 with SMTP id z7mr21340349qkd.316.1486975983460; Mon, 13 Feb 2017 00:53:03 -0800 (PST)
MIME-Version: 1.0
Received: by 10.140.19.112 with HTTP; Mon, 13 Feb 2017 00:53:02 -0800 (PST)
In-Reply-To: <daa227a4-e2b7-f9cc-7468-b1f2ebfc69c1@gmx.de>
References: <SYXPR01MB1615D5823473E6A9B5F0C80DE57C0@SYXPR01MB1615.ausprd01.prod.outlook.com> <CABkgnnWE38wbhKfp+5nF1hfn7qH4-6Uk4QMGBKgGL6-f_em_KA@mail.gmail.com> <1459eb07-f8cb-ff90-6101-be05f80c76aa@gmx.de> <CABkgnnVVc3OvJh1ukTuaFmrbOLgEiVWSqfKGP74ct=TKxpZxTg@mail.gmail.com> <SYXPR01MB1615A9EA6825C721A3ACCEA9E5460@SYXPR01MB1615.ausprd01.prod.outlook.com> <daa227a4-e2b7-f9cc-7468-b1f2ebfc69c1@gmx.de>
From: Martin Thomson <martin.thomson@gmail.com>
Date: Mon, 13 Feb 2017 19:53:02 +1100
Message-ID: <CABkgnnUxtcNnrs=O3bVNbuMnLuX6HpHNG-bkhDQn7ZZmzvuiiA@mail.gmail.com>
To: Julian Reschke <julian.reschke@gmx.de>
Cc: "Manger, James" <James.H.Manger@team.telstra.com>, "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=209.85.220.193; envelope-from=martin.thomson@gmail.com; helo=mail-qk0-f193.google.com
X-W3C-Hub-Spam-Status: No, score=-5.7
X-W3C-Hub-Spam-Report: AWL=-0.214, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1cdCTo-0002ss-8g ab12f737231f6440189fd2cf5eaef1b0
X-Original-To: ietf-http-wg@w3.org
Subject: Re: aes128gcm: is the 1st example wrong?
Archived-At: <http://www.w3.org/mid/CABkgnnUxtcNnrs=O3bVNbuMnLuX6HpHNG-bkhDQn7ZZmzvuiiA@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/33480
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On 13 February 2017 at 19:09, Julian Reschke <julian.reschke@gmx.de> wrote:
> So... where do I get the padding length from under the new format?


You count from the end of the plaintext.  All the zeros are padding.
The first non-zero octet (starting from the end) is the end of the
padding and should be 0x01 (regular) or 0x02 (last record).