On Sun, Feb 1, 2015 at 1:07 PM, Jakub Zelenka <bu...@php.net> wrote:

> Hey,
>
> On Sun, Feb 1, 2015 at 5:49 PM, Daniel Lowrey <rdlow...@php.net> wrote:
>>
>>   - openssl_decrypt() now returns mixed ... if $options['get_tag'] == true
>> then return [$decryptedString, $tag], otherwise return $decrypted string
>> as
>> before to preserve BC.
>>   - the encrypt function could use $options['set_tag'] to define that (or
>> any other secondary information needed for the operation).
>>
>
> I think that you confused it a bit :). The encryption results in cipher
> text and a tag. The decryption then validates the tag so you pass the tag
> as a parameter.
>

Okay, you see what I'm getting at :)


> Except that it's almost the same what I thought. I'm just not sure that
> mixed return value is a good idea. It seems a bit better having tag as a
> reference to me. But it's just a small detail that could be added to the
> RFC as a choice :)
>

My personal preference is to minimize the API and not add a sixth (!)
parameter (by-ref at that) to the method signature. I see a mixed return
with a simplified API as the lesser of the two evils, but like you say
that's just bikeshedding and can be part of a brief RFC on the subject.

Reply via email to