Newsgroups: php.doc,php.internals Path: news.php.net Xref: news.php.net php.doc:969386583 php.internals:98990 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43726 invoked from network); 9 May 2017 21:45:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 May 2017 21:45:49 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:44132] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 07/50-41573-C8832195 for ; Tue, 09 May 2017 17:45:49 -0400 Received: (qmail 46845 invoked by uid 89); 9 May 2017 21:45:44 -0000 Received: from unknown (HELO mail-qk0-f180.google.com) (yohgaki@ohgaki.net@209.85.220.180) by 0 with ESMTPA; 9 May 2017 21:45:44 -0000 Received: by mail-qk0-f180.google.com with SMTP id k74so13246680qke.1; Tue, 09 May 2017 14:45:43 -0700 (PDT) X-Gm-Message-State: AODbwcArwqpW3ZyDzZqLqSItX9qx8/CAE+Vm/osxFJi7jw0xlTzBStXq tYCsPbIh/XKOrH0tNMB4L8R0VbZbVA== X-Received: by 10.55.26.27 with SMTP id a27mr2244519qka.73.1494366337910; Tue, 09 May 2017 14:45:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.27.179 with HTTP; Tue, 9 May 2017 14:44:57 -0700 (PDT) In-Reply-To: References: <1924612862.1298112.1492071094545.JavaMail.zimbra@pieterhordijk.com> <690015854.1384408.1492163148986.JavaMail.zimbra@pieterhordijk.com> Date: Wed, 10 May 2017 06:44:57 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Andrey Andreev Cc: Niklas Keller , Pieter Hordijk , Joe Watkins , internals , phpdoc , Nikita Popov Content-Type: multipart/alternative; boundary=001a11471d5ebc4fb0054f1e46cb Subject: Re: [PHP-DEV] [RFC][VOTE] Improve hash_hkdf() parameter From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11471d5ebc4fb0054f1e46cb Content-Type: text/plain; charset=UTF-8 Hi Andrey, On Sun, Apr 30, 2017 at 8:26 AM, Yasuo Ohgaki wrote: > On Sun, Apr 30, 2017 at 8:14 AM, Yasuo Ohgaki wrote: > >> I don't need your view of HKDF RFC or usage, but I do need good practical >> examples that justify your point of view. Please don't waste of your/my >> time, >> just give some good examples in next reply. Thanks. >> > > BTW, valid (yet not common/proper) example that I can think of is, > > $strong_512bit_key = random_bytes(64); > $strong_256bit_key = hash_hkdf('sha3-512', $strong_512bit_key, 32); > ?> > > while it does not even require HKDF, though. > > $strong_512bit_key = random_bytes(64); > $strong_256bit_key = hash('sha3-256', $strong_512bit_key); > ?> > > should be good enough. > > Even with "Info", following HMAC is enough. > > $strong_512bit_key = random_bytes(64); > $strong_256bit_key = hash_hmac('sha3-256', $strong_512bit_key, $some_info); > ?> > I'm only asking examples for long enough time. I presume you cannot think of any valid and good example that justify current hash_hkdf() signature. Then documentation must stress not to use hash_hkdf() only with "length" and "length/info". Regards, P.S. Draft doc patch is this. (Not updated yet) https://gist.github.com/anonymous/ace4fa267f20041676f265fe58c3f1ea -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11471d5ebc4fb0054f1e46cb--