Re: [Trans] Verifying inclusion proof

Al Cutter <al@google.com> Fri, 26 June 2015 15:27 UTC

Return-Path: <alcutter@google.com>
X-Original-To: trans@ietfa.amsl.com
Delivered-To: trans@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4E18F1A1A07 for <trans@ietfa.amsl.com>; Fri, 26 Jun 2015 08:27:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.788
X-Spam-Level:
X-Spam-Status: No, score=-0.788 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, J_CHICKENPOX_21=0.6, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=no
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 cyHt6B3X_AoC for <trans@ietfa.amsl.com>; Fri, 26 Jun 2015 08:27:38 -0700 (PDT)
Received: from mail-ie0-x232.google.com (mail-ie0-x232.google.com [IPv6:2607:f8b0:4001:c03::232]) (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 D56061A0095 for <trans@ietf.org>; Fri, 26 Jun 2015 08:27:37 -0700 (PDT)
Received: by iebrt9 with SMTP id rt9so78030080ieb.2 for <trans@ietf.org>; Fri, 26 Jun 2015 08:27:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7n76ulBXZrk/P+LhrjzPd4Vp9Ts2kQReqbUbyqVna3Y=; b=k8Kf+iff1k20lnf4wZ68HfpWbQsrL0pSYyqrLVr+KzAGempj6eAXb/og7cW44sIafM k7+3S7LRHyWD9kKu6lJn3mHJCnBC+GH/MMTkWwsh3N/Kj+IkXxXOkpg961COUlZNpaat C11SL+rb4iM9x+KlHHN/aKTq9lanHVUHwmlo/n73qCXhtLHUQe+eFgvjz32f0BnmNEg+ R8bMkfCBEhCQtaAEYpCTQLldHBOvivcvX+4A27r8N4xxorO4IfWf2exDgJd/ZFWLE58G SJEAfKbtpldKCtrdXDwg8uOKbzsoa+swarOfg6+sNYB0TKsK3336wjOIU6bsVZKlwsO8 NW9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=7n76ulBXZrk/P+LhrjzPd4Vp9Ts2kQReqbUbyqVna3Y=; b=eBn5Q6ayVks5F2Rw5KGNTiUc9NJ8EhkMl2hxtJ2IT94IgvCbt2qrOVgkBIzyZooY1N RqC0sWlwOSn7WujPV4JLIQEkXbmCHtDB+2MMFjVll1mwggY4kkqX7T8ApAFf8xilHIsL YqDaAtenaq0BmdF4Hglj7fumS1LNB3lUK4HPT3En/G9SZ3n1TMpPD8dIoduVgWj8GVnY kxLOx+tTq31gG1X3iupjiMXnhMPsJKFDTff+xurRyvPHyMVhg2GHexSs6A5JDMVkc0WO ReZEkMRA3Ua+2YXoDyYrLqfwy8zjcBiXXTwcRjnGS9o2CQcvPCor4ndLuQv26ya1wY8W ZtZQ==
X-Gm-Message-State: ALoCoQkSS/uX+RnVwVoP5CZGmGmeEcTuzcEBA8BL+EbsznPdhLnMxIFviYWnILgVAZj7CuR+OuYm
MIME-Version: 1.0
X-Received: by 10.42.85.207 with SMTP id r15mr4132906icl.94.1435332457248; Fri, 26 Jun 2015 08:27:37 -0700 (PDT)
Received: by 10.36.54.68 with HTTP; Fri, 26 Jun 2015 08:27:37 -0700 (PDT)
In-Reply-To: <558D61DE.8020402@nic.cz>
References: <558D61DE.8020402@nic.cz>
Date: Fri, 26 Jun 2015 16:27:37 +0100
Message-ID: <CACM=_OeTnNCk+VSiQ1E5T2_a7YkxwxZ2w8HJSg13wtVc2wQUfA@mail.gmail.com>
From: Al Cutter <al@google.com>
To: Ondrej Mikle <ondrej.mikle@nic.cz>
Content-Type: multipart/alternative; boundary="20cf303349653fe99405196d61f1"
Archived-At: <http://mailarchive.ietf.org/arch/msg/trans/ukXlEDMXjkMjRXkgNmG3C2VbNXs>
X-Mailman-Approved-At: Fri, 26 Jun 2015 17:52:40 -0700
Cc: trans@ietf.org
Subject: Re: [Trans] Verifying inclusion proof
X-BeenThere: trans@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Public Notary Transparency working group discussion list <trans.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/trans>, <mailto:trans-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/trans/>
List-Post: <mailto:trans@ietf.org>
List-Help: <mailto:trans-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/trans>, <mailto:trans-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 26 Jun 2015 15:27:39 -0000

On Fri, Jun 26, 2015 at 3:29 PM, Ondrej Mikle <ondrej.mikle@nic.cz> wrote:

> Pardon me if I am asking something obvious, but I'm missing one piece of
> information for inclusion proof verification - the "placement" of each
> node returned from "get-proof-by-hash" method in audit_path list
> (whether it's left subtree or right subtree).
>
> Since the hashing of concatenation of strings is not commutative, the
> auditor needs to put the two partial tree hashes in correct order to get
> to the correct root hash.
>

Yes, you're quite right.


>
> I'd guess the placement of the missing nodes from audit_path could be
> derived from leaf_index and tree_size, but can't see a straightforward
> way to do it. The reference client does not implement this verification
> either.
>
>
There are a couple of implementations of this in the o/s code base:
C++ is in cpp/merkletree/merkle_verifier.cc
<https://github.com/google/certificate-transparency/blob/master/cpp/merkletree/merkle_verifier.cc>
(see
VerifyPath())
Python is in python/ct/crypto/merkle.py
<https://github.com/google/certificate-transparency/blob/master/python/ct/crypto/merkle.py>
 (see verify_leaf_inclusion())

HTH.

Cheers,
Al.



> Ondrej
>
> _______________________________________________
> Trans mailing list
> Trans@ietf.org
> https://www.ietf.org/mailman/listinfo/trans
>



-- 
Google UK Ltd | 123 Buckingham Palace Road | London SW1W 9SH | Registered
in England Number: 3977902