Return-Path: <cpatton@cloudflare.com>
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 83CA4C1840EA
	for <cfrg@ietfa.amsl.com>; Fri, 20 Sep 2024 15:43:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level: 
X-Spam-Status: No, score=-2.104 tagged_above=-999 required=5
	tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001,
	SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01,
	URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001,
	URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key)
	header.d=cloudflare.com
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 oWkAgqM-QDtk for <cfrg@ietfa.amsl.com>;
	Fri, 20 Sep 2024 15:43:52 -0700 (PDT)
Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com
 [IPv6:2607:f8b0:4864:20::836])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256)
	(No client certificate requested)
	by ietfa.amsl.com (Postfix) with ESMTPS id C5C0AC180B69
	for <cfrg@irtf.org>; Fri, 20 Sep 2024 15:43:52 -0700 (PDT)
Received: by mail-qt1-x836.google.com with SMTP id
 d75a77b69052e-4582c4aa2c2so15138121cf.0
        for <cfrg@irtf.org>; Fri, 20 Sep 2024 15:43:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloudflare.com; s=google09082023; t=1726872232; x=1727477032;
 darn=irtf.org;
        h=to:subject:message-id:date:from:in-reply-to:references:mime-version
         :from:to:cc:subject:date:message-id:reply-to;
        bh=MBGjxVyQOMzk7Iz1I9S0MbZLFPmrOSVhHK2/rjVbdLs=;
        b=HtQ4P8Y+kAfBEPlnTZKV04MNMm1Gx+k8ODBaqKjPpRQIQ9JIS/TEY/kCOXmEfKIjlF
         f6AePrqe7WnWlMBxcwAG4KGWAiFuMUE81yS91O/U+MwYfvhKPCq28ucr6TjkkG87pZps
         TXmiEUJv+UMqyHjpvgK9CrKJfUiS9qSsuTW3a+4kHHJyx0pvWL9FGhhamZxxVzX+YYrx
         mwRRDbmXH/Bqn/8TFobEbo7YeqUomzi/BiJ9MDY5t7rqsDDMx4MYsGg21KyC8HuTIe/2
         F6z515DfyZ0CU5BWHLNk9rmdDi0qwPbS0LSQgHzCHLPGuQ3CbGJgR8/9PPnC51NOoHTv
         +Htw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1726872232; x=1727477032;
        h=to:subject:message-id:date:from:in-reply-to:references:mime-version
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=MBGjxVyQOMzk7Iz1I9S0MbZLFPmrOSVhHK2/rjVbdLs=;
        b=S64BsvYmVvIRWm/nIaI7RNtTe79F8FZZiNvRqLkTFqJxe5SUi79guPOOyLnq0tl6Vh
         l7DJXNPkThanxTHFhW8Blna2bgJ2AWDEz9UhXgatm9fDYWOJDqvJ5Fs7UUhD7I3BembH
         B5i+dVDAILejGpJYY1k4DCxnuz08ISJE4aZuXhJ2+bStk45VyDmbuZ4mPVumiI/4GeG/
         moJ/QBl/cd6dhunPc8ANIfO4rPcJy6FYbJBXn/KH72+RCIEMwmdyVWQUUpajai4E528E
         m9U8YTBQom07mZoSg++3sHUtSuDHc43tmf/29NUfbXzuzT8cKqoznDqTtxULmL5c7Nw/
         Qf8Q==
X-Gm-Message-State: AOJu0YzaFAFaS6h/yq6SBBbXzsxoQXKO282NJUOkXeXyBlfmJTiMFD4b
	OP0NXvtLUqYyyakpbCNftL+PX/xufXqzov+74KgFG8KammBOSq6IaWbB1McJnNVfpyICrfOunDS
	6unhlHzHGyA79PI1e0kY3gOx3l3YlJhQdNUUYeBkW3O1hArD0AMaxvg==
X-Google-Smtp-Source: 
 AGHT+IHw/zmoVJAlrcDYiEQ/t4+HnhTfCJFvvY780jd8OrfndBqSBcpZWidacd4t6IixCj2fxN3fB8RyxkLz/YsreYg=
X-Received: by 2002:a05:622a:45:b0:458:5482:c565 with SMTP id
 d75a77b69052e-45b2053cf5dmr55404421cf.41.1726872231753; Fri, 20 Sep 2024
 15:43:51 -0700 (PDT)
MIME-Version: 1.0
References: 
 <CAG2Zi22ya_6h1Q_rs9Tf6tJ3qao-X2_wWhCgxoXD3OQnf+MOUw@mail.gmail.com>
 <20240920200220.402868.qmail@cr.yp.to>
In-Reply-To: <20240920200220.402868.qmail@cr.yp.to>
From: Christopher Patton <cpatton@cloudflare.com>
Date: Fri, 20 Sep 2024 15:43:41 -0700
Message-ID: 
 <CAG2Zi21QNTZ8rZ-j5nrkbRbrk4pdknXjdsCiLip30HjvweK9HA@mail.gmail.com>
To: cfrg@irtf.org
Content-Type: multipart/alternative; boundary="000000000000f25baf062294c56b"
Message-ID-Hash: UV3R4MD47IR2LL2DQNGPPOW44CRREV4A
X-Message-ID-Hash: UV3R4MD47IR2LL2DQNGPPOW44CRREV4A
X-MailFrom: cpatton@cloudflare.com
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: =?utf-8?q?=5BCFRG=5D_Re=3A_Where_should_test_vectors_live=3F?=
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
Archived-At: 
 <https://mailarchive.ietf.org/arch/msg/cfrg/ezlx-v3e4p7pgCglEDXqTeTiYjg>
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>

--000000000000f25baf062294c56b
Content-Type: text/plain; charset="UTF-8"

Dan,


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.


The draft in question does have reference code (
https://github.com/cfrg/draft-irtf-cfrg-vdaf/tree/main/poc/vdaf_poc), and
in fact we use this to generate test vectors and the spec itself (by
copy-pasting). The reference code is Python, but it requires SageMath to
run (e.g., `sage -python gen_test_vec.py` to generate test vectors). It
would be really cool to see implementers integrate the reference code
itself into their tests, though I think sage is too big a dependency to
carry around. We could probably remove it for this particular draft.

I think Python is by far the most common language for reference code at
CFRG. Some drafts require sage, others don't.

You may be interested in reviewing
https://github.com/cfrg/draft-irtf-cfrg-cryptography-specification.

Chris P.

--000000000000f25baf062294c56b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><div>Dan,</div><div><br></div><=
div><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr"><br></=
div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor=
der-left:1px solid rgb(204,204,204);padding-left:1ex">Instead of defining f=
ormats for test vectors, I would suggest defining a<br>
format for reference code (e.g., Python script meeting a specified API;<br>
can have the format say which Python version). An obvious illustration<br>
of using the format would be a general-purpose tool to create test<br>
vectors given the reference code---and then there&#39;s no reason to post<b=
r>
the test vectors; people should run the tools locally. SUPERCOP already<br>
generates tests for thousands of C implementations meeting the SUPERCOP<br>
API, and there are examples online of how to do the same tests in<br>
Python. SUPERCOP also supports generating implementation-specific tests;<br=
>
this is sometimes useful for testing slow-to-find corner cases.<br>
<br>
One advantage of this modularity is that implementors will easily be<br>
able to swap in different testing tools (e.g., using fuzzers, or simply<br>
testing more inputs) without being constrained by the limits of posted<br>
test vectors. Of course, reference code is also useful for much more<br>
than just testing.</blockquote><div><br></div><div>The draft in question do=
es have reference code (<a href=3D"https://github.com/cfrg/draft-irtf-cfrg-=
vdaf/tree/main/poc/vdaf_poc">https://github.com/cfrg/draft-irtf-cfrg-vdaf/t=
ree/main/poc/vdaf_poc</a>), and in fact we use this to generate test vector=
s and the spec itself (by copy-pasting). The reference code is Python, but =
it requires SageMath to run (e.g., `sage -python gen_test_vec.py` to genera=
te test vectors). It would be really cool to see implementers integrate the=
 reference code itself into their tests, though I think sage is too big a d=
ependency to carry around. We could probably remove it for this particular =
draft.</div><div><br></div><div>I think Python is by far the most common la=
nguage for reference code at CFRG. Some drafts require sage, others don&#39=
;t.</div><div><br></div><div>You may be interested in reviewing <a href=3D"=
https://github.com/cfrg/draft-irtf-cfrg-cryptography-specification">https:/=
/github.com/cfrg/draft-irtf-cfrg-cryptography-specification</a>.</div><div>=
<br></div><div>Chris P.<br></div><br></div></div></div>

--000000000000f25baf062294c56b--

