Browse Source

loosen the spec for timingsafe functions slightly, so as to not

artificially constrain alternative implementations. ok deraadt
OPENBSD_5_6
tedu 10 years ago
parent
commit
f0d4f91f14
1 changed files with 5 additions and 10 deletions
  1. +5
    -10
      src/lib/libc/string/timingsafe_bcmp.3

+ 5
- 10
src/lib/libc/string/timingsafe_bcmp.3 View File

@ -1,4 +1,4 @@
.\" $OpenBSD: timingsafe_bcmp.3,v 1.1 2014/06/13 02:12:17 matthew Exp $
.\" $OpenBSD: timingsafe_bcmp.3,v 1.2 2014/06/21 20:22:15 tedu Exp $
.\" .\"
.\" Copyright (c) 2014 Google Inc. .\" Copyright (c) 2014 Google Inc.
.\" .\"
@ -13,7 +13,7 @@
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.Dd $Mdocdate: June 13 2014 $
.Dd $Mdocdate: June 21 2014 $
.Dt TIMINGSAFE_BCMP 3 .Dt TIMINGSAFE_BCMP 3
.Os .Os
.Sh NAME .Sh NAME
@ -50,7 +50,7 @@ may short-circuit after finding the first differing byte.
.Sh RETURN VALUES .Sh RETURN VALUES
The The
.Fn timingsafe_bcmp .Fn timingsafe_bcmp
function returns 0 or 1 if the byte sequence pointed to by
function returns 0 or not zero if the byte sequence pointed to by
.Fa b1 .Fa b1
compares equal to or not equal to (respectively) compares equal to or not equal to (respectively)
the byte sequence pointed to by the byte sequence pointed to by
@ -58,17 +58,12 @@ the byte sequence pointed to by
.Pp .Pp
The The
.Fn timingsafe_memcmp .Fn timingsafe_memcmp
function returns \-1, 0, or 1 if the byte sequence pointed to by
function returns a negative value, 0, or positive value if the byte sequence
pointed to by
.Fa b1 .Fa b1
compares less than, equal to, or greater than (respectively) compares less than, equal to, or greater than (respectively)
the byte sequence pointed to by the byte sequence pointed to by
.Fa b2 . .Fa b2 .
.Pp
Note that these return values are compatible with, but stricter than,
the ones specified for
.Xr bcmp 3
and
.Xr memcmp 3 .
.Sh SEE ALSO .Sh SEE ALSO
.Xr bcmp 3 , .Xr bcmp 3 ,
.Xr memcmp 3 .Xr memcmp 3


Loading…
Cancel
Save