tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: New function: consttime_memcmp(3)



On Mon, 16 Mar 2015, Kamil Rytarowski wrote:
I'm attaching a patch against current adding a new libc and kernel function: consttime_memcmp(3). The code is borrowed from OpenBSD timingsafe_memcmp(3) [1].

I haven't looked at the code, but what use case do you have that needs constant-time memcmp-like behaviour (with a three-state return: negative, zero, or positive), as opposed to the behaviour already provided by NetBSD's consttime_memequal(3) function (with a two-state return: non-zero or zero).

I also have an implementation of consttime_memcmp(), but I have found no use for it that cannot be satisfied by consttime_memequal().

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index