[CFRG] Re: Where should test vectors live?

"D. J. Bernstein" <djb@cr.yp.to> Fri, 20 September 2024 20:02 UTC

Return-Path: <djb-dsn2-1406711340.7506@cr.yp.to>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 86AF1C151992 for <cfrg@ietfa.amsl.com>; Fri, 20 Sep 2024 13:02:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.908
X-Spam-Level:
X-Spam-Status: No, score=-6.908 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, UNPARSEABLE_RELAY=0.001] autolearn=ham autolearn_force=no
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 KYfshu3eKaKy for <cfrg@ietfa.amsl.com>; Fri, 20 Sep 2024 13:02:28 -0700 (PDT)
Received: from salsa.cs.uic.edu (salsa.cs.uic.edu [131.193.32.108]) by ietfa.amsl.com (Postfix) with SMTP id B5004C1519AB for <cfrg@irtf.org>; Fri, 20 Sep 2024 13:02:28 -0700 (PDT)
Received: (qmail 24010 invoked by uid 1010); 20 Sep 2024 20:02:27 -0000
Received: from unknown (unknown) by unknown with QMTP; 20 Sep 2024 20:02:27 -0000
Received: (qmail 402870 invoked by uid 1000); 20 Sep 2024 20:02:20 -0000
Date: Fri, 20 Sep 2024 20:02:20 -0000
Message-ID: <20240920200220.402868.qmail@cr.yp.to>
From: "D. J. Bernstein" <djb@cr.yp.to>
To: cfrg@irtf.org
Mail-Followup-To: cfrg@irtf.org
In-Reply-To: <CAG2Zi22ya_6h1Q_rs9Tf6tJ3qao-X2_wWhCgxoXD3OQnf+MOUw@mail.gmail.com>
Message-ID-Hash: FUUR7IGKQ5BTNSZ2CVHRMTWVTU4662D3
X-Message-ID-Hash: FUUR7IGKQ5BTNSZ2CVHRMTWVTU4662D3
X-MailFrom: djb-dsn2-1406711340.7506@cr.yp.to
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cfrg.irtf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [CFRG] Re: Where should test vectors live?
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/ht4YzBMYWoQvKxlCxx-CAPJFtC0>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Owner: <mailto:cfrg-owner@irtf.org>
List-Post: <mailto:cfrg@irtf.org>
List-Subscribe: <mailto:cfrg-join@irtf.org>
List-Unsubscribe: <mailto:cfrg-leave@irtf.org>

Instead of defining formats for test vectors, I would suggest defining a
format for reference code (e.g., Python script meeting a specified API;
can have the format say which Python version). An obvious illustration
of using the format would be a general-purpose tool to create test
vectors given the reference code---and then there's no reason to post
the test vectors; people should run the tools locally. SUPERCOP already
generates tests for thousands of C implementations meeting the SUPERCOP
API, and there are examples online of how to do the same tests in
Python. SUPERCOP also supports generating implementation-specific tests;
this is sometimes useful for testing slow-to-find corner cases.

One advantage of this modularity is that implementors will easily be
able to swap in different testing tools (e.g., using fuzzers, or simply
testing more inputs) without being constrained by the limits of posted
test vectors. Of course, reference code is also useful for much more
than just testing.

---D. J. Bernstein