Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81098 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11978 invoked from network); 24 Jan 2015 23:33:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jan 2015 23:33:56 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.175 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.175 mail-qc0-f175.google.com Received: from [209.85.216.175] ([209.85.216.175:38298] helo=mail-qc0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/00-11456-2EB24C45 for ; Sat, 24 Jan 2015 18:33:56 -0500 Received: by mail-qc0-f175.google.com with SMTP id c9so2743804qcz.6 for ; Sat, 24 Jan 2015 15:33:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=aCQhq+Butjq7C7zLM9ckg2wrW5q9uCIxToYsYpx2JJM=; b=K79zE0XY/bp4FDC1iAYUMpS15qwJEIvAenJ4o6GBYDZo8lH/6xsWCCmJu7ifhltyQB 6qzPxHzn0ylMwahShbgFXoYS3ZI0JI8A/h78zGUvxvqDGTc1oEfGqXpeDRlElJOc0rhR 26S9KRNa+sZLoIva4+k2AuvzVCEREx59cloJ4MWQBvPAidc9XIDxfYsVhenaT3gDmzOG N26JeqZx55qK/hxdjg9+rfnHigCZK/skTuAEOjsDjHLS5oZek7wH/CTpG3H6mT4SSzrT MUG6mRZ2AN4lsm/zBfhfl8sicMLFGjeCzydLcNhD12CPdbeiJRi7USBMlcseRFzv658v JorQ== X-Received: by 10.224.114.209 with SMTP id f17mr9396480qaq.68.1422142432546; Sat, 24 Jan 2015 15:33:52 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.93.70 with HTTP; Sat, 24 Jan 2015 15:33:12 -0800 (PST) In-Reply-To: References: Date: Sun, 25 Jan 2015 08:33:12 +0900 X-Google-Sender-Auth: rBmCFl1OZQrtbER6zxN6xqzb7LE Message-ID: To: Scott Arciszewski Cc: "inter >> PHP internals" Content-Type: multipart/alternative; boundary=047d7bdc19ac832c6e050d6e568b Subject: Re: [PHP-DEV] Constant-Time Encoding Functions From: yohgaki@ohgaki.net (Yasuo Ohgaki) --047d7bdc19ac832c6e050d6e568b Content-Type: text/plain; charset=UTF-8 Hi Scott, On Fri, Jan 23, 2015 at 12:21 AM, Scott Arciszewski wrote: > I've squashed and rebased my pull request that adds a cache-timing-safe > bin2hex implementation (named ts_bin2hex) to PHP. > > https://github.com/php/php-src/pull/909 > > Before I put more effort into the inverse operation (which, from what I can > tell, is already constant-time), does anyone have a better naming > convention suggestion? > First of all, I'm +1 for having dedicated API for these functions. i.e. Not an option for existing functions. I would rather postfix 'ts'. e.g. bin2hex_ts The reason why I prefer postfix is PHP functions are named like 'module name' _ 'function name' ts_*() seems like module function. Furthermore, should a similar effort be expended for base64 > encoding/decoding functions? > base64 is used to encode binary to text commonly. If it can be timing safe, it would be great! Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --047d7bdc19ac832c6e050d6e568b--