From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IJuaO1ADmmGq8AAAgWs5BA (envelope-from ) for ; Sun, 21 Nov 2021 09:29:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SOZYN1ADmmHnDwAA1q6Kng (envelope-from ) for ; Sun, 21 Nov 2021 08:29:04 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1E08917F07 for ; Sun, 21 Nov 2021 09:29:03 +0100 (CET) Received: from localhost ([::1]:53148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moiDd-00014e-Nt for larch@yhetil.org; Sun, 21 Nov 2021 03:29:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moiDS-00014U-0d for guix-devel@gnu.org; Sun, 21 Nov 2021 03:28:50 -0500 Received: from [2a00:1450:4864:20::341] (port=37621 helo=mail-wm1-x341.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moiDQ-0007RI-7Y; Sun, 21 Nov 2021 03:28:49 -0500 Received: by mail-wm1-x341.google.com with SMTP id k37-20020a05600c1ca500b00330cb84834fso14042813wms.2; Sun, 21 Nov 2021 00:28:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=n0wpB0kx1xBfiHqVZEHZ2dAJ/B8Xj83sOfCpeVELwME=; b=FF6ZYrRR85NW72YxnI3V7Vz5fblrxFdo5u+ZUsQwsNJoT0PAWt3iFXAbuv+lXcNORv lxT8ykZt5PPCYynNqFziQ01ee2p1V8v/VWcDUHwE+LFbEi9E70YGEE9sUy91+FERLdeB t1E5CTJ3NSCz9Ic+GMKdX51svTLoE5gjp8MYsV2tcwX2hrnou3kxV250dZJjQ5Jedvdk j3fAXiyfS3CRsH9yaP4edKssjFZAl344ODJCpHENrNP7YgBzZdg8APskfKlEHQLT8GR7 aUPbDTrlCkQHERDUikVQSpHz+g1utK1LTka8nFAowptnCKcRGdSBRgeDMlAiON0bftza 9S0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=n0wpB0kx1xBfiHqVZEHZ2dAJ/B8Xj83sOfCpeVELwME=; b=d4GHHrKnp5pRpLjIuGmB81LbKSxgfGGc1NHPw7kobbK1rhC+75FZ1MTDBeTuZCD0Lr uC5I75UOGLoL4DBJAGZAxgYzRj0NubSMJF4c5P4hK61IeO4hLL70QtutFVenK6s6yY4v HiR3AUof9SVlkAttiI1N+nQ5hOpdtsVXjzjunku9/tkwm92sYQD1eOGf3JDj+UDGTwdF It8vsHPaTdv7+REs6SsNAxXsNdBnOW3BY4nHhhqXJkOxtGYYtomQ/iJC57F9+r4ozwtt pmQupOWgyzGIDDdVMSUstN/2jtbR3hMJdOG9pxWHGiA8R1PytGPhG6fgSJ00jGTRtJSd IMFw== X-Gm-Message-State: AOAM533tJK/0yEfPkqn8z4jxxfdR+1OaLKIEJ6FmnvfOHdjQo6Fd9BTP GfLj1NRHFG8qTExuhZ57vSg= X-Google-Smtp-Source: ABdhPJww/keHCLB6pE2vbal9lY9gWM2Q80/VAw4gp1PW0DqmKeTfkKLTtiEA6NPKzXjWiqz/XwI4wg== X-Received: by 2002:a1c:9a4f:: with SMTP id c76mr17538370wme.162.1637483326042; Sun, 21 Nov 2021 00:28:46 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id l8sm18566485wmc.40.2021.11.21.00.28.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Nov 2021 00:28:45 -0800 (PST) Message-ID: Subject: Re: Using G-Expressions for public keys (substitutes and possibly more) From: Liliana Marie Prikler To: Jelle Licht , Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Sun, 21 Nov 2021 09:28:44 +0100 In-Reply-To: <86k0h2jris.fsf@fsfe.org> References: <5f7e587c376ed0abffa321152e185cbf4014e05b.camel@gmail.com> <87wnm6w2yz.fsf@gnu.org> <86k0h2jris.fsf@fsfe.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::341 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=liliana.prikler@gmail.com; helo=mail-wm1-x341.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637483343; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=n0wpB0kx1xBfiHqVZEHZ2dAJ/B8Xj83sOfCpeVELwME=; b=LZcUJUQN0zrxElPNyfemP+NDr279oJZjXF5n1ybOKMjkl8nO1W0wdbvwr4LND22UVTarME Le+aOUxuyd/kM55daCZGYqXs4v7b/9F+X4DYAjMy6EB+XXtIt7K5TNBfsAkh8w/TRfObAk aiqUdxzAvwykxwp8s4wKIOFv89TvJyzzpDC5O0hmYsL5rMNTY2O57khOmmA1kTkJMZC7pe VofIRbt2YY/e0yijv9qwagVE49vGW2f0/0Q0SvV/97rpKbTjzCoQ5gp4EgKKYU1jJOCHdd kDsKBL9/+fmCDiW2y+eHkYFFEA7KrZSTQHItCKT1fLpbGdmLkMz08Q/h/fUDrw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637483343; a=rsa-sha256; cv=none; b=dkTtUqgab4mLWloEFtiXHRyPMvsb+qYXh6bE2YJ68/6RV9iEogAYx2RlPlDJLNZzi5wHb5 4VfZWcNoaMe1CP3r91dWQsHO1TBSdYXm4Yt1vRDa4qwFQ4l+4k26PvJdGKX7bqo6c7bODF JS6NfCVda5000CDfC+MtF16T4mqQJ6Y75h9tT1Mditk+iLLSO+6val7R2omjFWGPYM2CuQ 9/01ZTyzxZWqRv6hHGyReCeh3WOOkAvJVIShb6z3CGJNB+YM+czvXQIbpWEUx9sggSoz7L fHje56KQG8aCQydao1eGAZIDYwAxa/REwVtx/jrT2RpryN0sLI/124TI5JOV6g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FF6ZYrRR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.08 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FF6ZYrRR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1E08917F07 X-Spam-Score: -4.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: iQo/bDP7n9M2 Hi, Am Sonntag, den 21.11.2021, 01:12 +0100 schrieb Jelle Licht: > What about something such as the following? > > --8<---------------cut here---------------start------------->8--- > (use-modules (gcrypt base16) > (gcrypt pk-crypto)) > > (define-record-type > (canonical-sexp-wrapper name sexp) > canonical-sexp-wrapper? > (name canonical-sexp-wrapper-name) > (sexp canonical-sexp-wrapper-sexp)) > > (define-gexp-compiler (canonical-sexp-wrapper-compiler > (wrapper ) system > target) > (match wrapper > (($ name sexp) > (text-file name (canonical-sexp->string > (sexp->canonical-sexp sexp)) '())))) > --8<---------------cut here---------------end--------------->8--- > > This would still leave constructing your s-expression as an exercise > to the reader, which is definitely not amazing. In this specific > instance, I had to look at the output of canonical-sexp->sexp, which > is of course whatever the opposite of discoverable and good UX :). Apart from the name "-wrapper" instead of "-file", I think this would be acceptable. I think we ought to handle two cases here, though: one with sexp being a sexp, and one with it being a canonical sexp. > For the Ed25519 key: > --8<---------------cut here---------------start------------->8--- > (define my-public-key > (canonical-sexp-wrapper > "my-key.pub" > `(public-key > (ecc > (curve Ed25519) > (q ,(base16-string->bytevector > (string-downcase > "C9F307AE..."))))))) > --8<---------------cut here---------------end--------------->8--- > > To improve on this, is one sexp-based-gexp-compiler + N helper > functions to construct the most-used value types a direction worth > exploring? I think we would probably want to improve on this end in the guile- gcrypt module, i.e. have a public-key "constructor" that returns a canonical-sexp and so on. WDYT?