diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-06-21 20:22:16 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-06-21 20:22:16 +0000 |
commit | 56281b6e738163a96b6a5d3f95b85fe7d2bc20d9 (patch) | |
tree | 66004e04df5059df02584f9e82eb815c7c6c0432 /lib/libc/string | |
parent | c749b516cfae9fd8bc06e050d148cf5fd7855e4f (diff) |
loosen the spec for timingsafe functions slightly, so as to not
artificially constrain alternative implementations. ok deraadt
Diffstat (limited to 'lib/libc/string')
-rw-r--r-- | lib/libc/string/timingsafe_bcmp.3 | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/libc/string/timingsafe_bcmp.3 b/lib/libc/string/timingsafe_bcmp.3 index 0886731ce7b..00da769157e 100644 --- a/lib/libc/string/timingsafe_bcmp.3 +++ b/lib/libc/string/timingsafe_bcmp.3 @@ -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. .\" @@ -13,7 +13,7 @@ .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" 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 .Os .Sh NAME @@ -50,7 +50,7 @@ may short-circuit after finding the first differing byte. .Sh RETURN VALUES The .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 compares equal to or not equal to (respectively) the byte sequence pointed to by @@ -58,17 +58,12 @@ the byte sequence pointed to by .Pp The .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 compares less than, equal to, or greater than (respectively) the byte sequence pointed to by .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 .Xr bcmp 3 , .Xr memcmp 3 |