Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93677 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58168 invoked from network); 1 Jun 2016 14:11:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jun 2016 14:11:20 -0000 Authentication-Results: pb1.pair.com header.from=scott@paragonie.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=scott@paragonie.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain paragonie.com designates 209.85.218.46 as permitted sender) X-PHP-List-Original-Sender: scott@paragonie.com X-Host-Fingerprint: 209.85.218.46 mail-oi0-f46.google.com Received: from [209.85.218.46] ([209.85.218.46:35158] helo=mail-oi0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/26-11325-50DEE475 for ; Wed, 01 Jun 2016 10:11:18 -0400 Received: by mail-oi0-f46.google.com with SMTP id w184so28950708oiw.2 for ; Wed, 01 Jun 2016 07:11:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragonie-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=G7FyKWjmq+KS4yZJ5C6YQd1oCSUEq9rBab7DWX/M/1I=; b=sBNPkhpp/AgYVb3BI0GgygvzrpH1RDjTTC+aBzUtnxsT6iniXnC7BbANLKIQFn4RPD bW2lsMQ1udEUrVa2NXFrCXzzSTcN6qw5b7CnP9QEVtueu4wkJagYULkrjRoXHUrxcmFd TNV2tw1269Podw1izC1jokeICh7jmTYvaUDvy9ZEMGgByzGPYWWCX37mlokFFGs1yy1a IfZSEFixrOYCFwKmBmGut+UWZT+TXzrAhzFb2BrJm4rs3w18y4/l06DKy/isexeUvlWj 60LMDPXO7TU4BjaXrFFQSry/lsIZkr2IF03+hHN9YaX2xolmO4nBWivt6YGkAvdYGqrB BYRw== 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; bh=G7FyKWjmq+KS4yZJ5C6YQd1oCSUEq9rBab7DWX/M/1I=; b=ZSJU67plCF6otTg9ddkF0zXzgzKvUNuP5Vlt6NOAVUqfHmfIaUdlOrP7g2hSh3vNNN LMWcOh/Gv6RKxRUQ4NPruDe4qDM0ljegGXnx5SDRKR/MWCqJdLKpQv9dvNlWoJ4HgbDm 8zOfSNQM9VZVK04O1HLqs0KuDW63S+MTJsmHGNdQ1OnnnVxesQAtlR8Lq6rbJTTYbjMB mHvz1U5bMECsGY6bV+Znmjbm3zMVerrfK7rl6QBFveLTr3PeZK7S7OESvAcRVGW1/MsP jHi+ehNgfCJH3TUk2zBatH8iJnwRP74SRvBDTwW/LnIhEabp+jFDDBOHWDOfQfd12yp7 Neqw== X-Gm-Message-State: ALyK8tJM8eS/ErUGyR0MJW+upr9fbdw2uYjjnXAjaJKA3G6TSNwJKsOu//zFyVu3XFc4Z2M0l6MA7ya/kGMCgQ== MIME-Version: 1.0 X-Received: by 10.157.14.131 with SMTP id 3mr2218565otj.83.1464790274650; Wed, 01 Jun 2016 07:11:14 -0700 (PDT) Received: by 10.157.26.106 with HTTP; Wed, 1 Jun 2016 07:11:14 -0700 (PDT) In-Reply-To: References: Date: Wed, 1 Jun 2016 10:11:14 -0400 Message-ID: To: Marco Pivetta Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11352d74fdcdd70534380f5b Subject: Re: [PHP-DEV] [RFC] Libsodium - Discussion From: scott@paragonie.com (Scott Arciszewski) --001a11352d74fdcdd70534380f5b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Jun 1, 2016 at 9:46 AM, Marco Pivetta wrote: > On 1 June 2016 at 15:45, Scott Arciszewski wrote: > >> On Wed, Jun 1, 2016 at 6:48 AM, Marco Pivetta wrote= : >> >>> Hey Scott, >>> >>> On 1 June 2016 at 09:49, Scott Arciszewski wrote: >>> >>>> Hi PHP Internals Team, >>>> >>>> Let's begin discussing the prospect of adding libsodium as a core >>>> extension >>>> in PHP 7.1. I've updated the RFC to explain why this would be a good >>>> idea >>>> and the benefits it offers. >>>> >>>> https://wiki.php.net/rfc/libsodium >>>> >>>> If the subsequent discussion goes smoothly, I would like to open votin= g >>>> on >>>> June 15. >>>> >>>> Together, let's make PHP cryptography so safe that it becomes boring. >>>> >>> >>> First, thanks for providing better alternatives to crypto in PHP! >>> >>> I also agree with Remi on naming: let's avoid calling the extension >>> `libsodium`. >>> >>> I have some concerns that are just about code quality, not about >>> functionality. Consider that I didn't look at the underlying library (a= nd I >>> really care little about it, from a consumer perspective). >>> >>> 1. is there a particular reason why abbreviations are used? For >>> instance, why `sodium_randombytes_buf()` instead of >>> `sodium_random_bytes_buffer()`? >>> 2. from a naming perspective, I'd expect `sodium_randombytes_buf()` to >>> give me a buffer of random bytes (probably as a stream), but it returns= the >>> actual string of random bytes. Again: confusing naming >>> 3. can we avoid using "themed" naming? For example, instead of >>> `sodium_crypto_secretbox()`, it would be best to express what it actual= ly >>> does, like `sodium_encrypt_and_sign()`. While the naming may be emergin= g >>> from lower layers, I still (like I did with other RFCs) disagree with >>> inheriting confusing naming. This will just cause users to look up the >>> naming up when reading or writing code, and ultimately add up to silly >>> bugs. I can already foresee that people will use the API incorrectly ju= st >>> because of the naming. >>> 4. can't we just keep it namespaced under `Sodium`, instead of adding >>> more stuff to the root level namespace? Does anyone have a reference to= the >>> coding standards that would cause the rename? >>> >>> Cheers, >>> >>> Marco Pivetta >>> >>> http://twitter.com/Ocramius >>> >>> http://ocramius.github.com/ >>> >>> >> =E2=80=8BI'd love to just keep the namespace personally >> =E2=80=8B ( >> Ke >> =E2=80=8Beping \Sodium\foo() and \SODIUM\FOO means code I've written tod= ay will >> work in 7.1 for non-PECL users >> =E2=80=8B, and less work we thrust on Frank Denis)=E2=80=8B >> =E2=80=8B >> but it was previously expressed that doing so violates the coding >> standard. >> =E2=80=8B Changing to sodium_* would mean less bikeshedding and automati= c "No" >> votes. >> > > Weird... I guess we could add a subsection to the vote? > > >> As for the function names, that's what they were called in NaCl. >> https://nacl.cr.yp.to/secretbox.html >> >> I believe randombytes_buf() was named in a similar spirit to OpenBSD's >> arc4random_buf(). >> > > Yeh, that is software archaeology though, not software design ;-) > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ > > =E2=80=8BI've added "proposed voting choices". 1. Adopt libsodium? 2. ...as-is? (Otherwise, prefix ahoy!) This is precisely the sort of thing that should be voted on rather than bikeshedded. :) Scott Arciszewski Chief Development Officer Paragon Initiative Enterprises =E2=80=8B --001a11352d74fdcdd70534380f5b--