diff options
author | tedu <> | 2014-06-21 20:22:15 +0000 |
---|---|---|
committer | tedu <> | 2014-06-21 20:22:15 +0000 |
commit | e4a00d72f460a6b1ae6fd91aae01686bfbd0f3f3 (patch) | |
tree | 2ef9d0844469225cc4094fefcf48cdca31e9fa0d | |
parent | 840f85a4ae7fc3a3cf71d93ab17fbab37c2cc3fc (diff) | |
download | openbsd-e4a00d72f460a6b1ae6fd91aae01686bfbd0f3f3.tar.gz openbsd-e4a00d72f460a6b1ae6fd91aae01686bfbd0f3f3.tar.bz2 openbsd-e4a00d72f460a6b1ae6fd91aae01686bfbd0f3f3.zip |
loosen the spec for timingsafe functions slightly, so as to not
artificially constrain alternative implementations. ok deraadt
-rw-r--r-- | src/lib/libc/string/timingsafe_bcmp.3 | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/lib/libc/string/timingsafe_bcmp.3 b/src/lib/libc/string/timingsafe_bcmp.3 index 0886731ce7..00da769157 100644 --- a/src/lib/libc/string/timingsafe_bcmp.3 +++ b/src/lib/libc/string/timingsafe_bcmp.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: timingsafe_bcmp.3,v 1.1 2014/06/13 02:12:17 matthew Exp $ | 1 | .\" $OpenBSD: timingsafe_bcmp.3,v 1.2 2014/06/21 20:22:15 tedu Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2014 Google Inc. | 3 | .\" Copyright (c) 2014 Google Inc. |
4 | .\" | 4 | .\" |
@@ -13,7 +13,7 @@ | |||
13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | .Dd $Mdocdate: June 13 2014 $ | 16 | .Dd $Mdocdate: June 21 2014 $ |
17 | .Dt TIMINGSAFE_BCMP 3 | 17 | .Dt TIMINGSAFE_BCMP 3 |
18 | .Os | 18 | .Os |
19 | .Sh NAME | 19 | .Sh NAME |
@@ -50,7 +50,7 @@ may short-circuit after finding the first differing byte. | |||
50 | .Sh RETURN VALUES | 50 | .Sh RETURN VALUES |
51 | The | 51 | The |
52 | .Fn timingsafe_bcmp | 52 | .Fn timingsafe_bcmp |
53 | function returns 0 or 1 if the byte sequence pointed to by | 53 | function returns 0 or not zero if the byte sequence pointed to by |
54 | .Fa b1 | 54 | .Fa b1 |
55 | compares equal to or not equal to (respectively) | 55 | compares equal to or not equal to (respectively) |
56 | the byte sequence pointed to by | 56 | the byte sequence pointed to by |
@@ -58,17 +58,12 @@ the byte sequence pointed to by | |||
58 | .Pp | 58 | .Pp |
59 | The | 59 | The |
60 | .Fn timingsafe_memcmp | 60 | .Fn timingsafe_memcmp |
61 | function returns \-1, 0, or 1 if the byte sequence pointed to by | 61 | function returns a negative value, 0, or positive value if the byte sequence |
62 | pointed to by | ||
62 | .Fa b1 | 63 | .Fa b1 |
63 | compares less than, equal to, or greater than (respectively) | 64 | compares less than, equal to, or greater than (respectively) |
64 | the byte sequence pointed to by | 65 | the byte sequence pointed to by |
65 | .Fa b2 . | 66 | .Fa b2 . |
66 | .Pp | ||
67 | Note that these return values are compatible with, but stricter than, | ||
68 | the ones specified for | ||
69 | .Xr bcmp 3 | ||
70 | and | ||
71 | .Xr memcmp 3 . | ||
72 | .Sh SEE ALSO | 67 | .Sh SEE ALSO |
73 | .Xr bcmp 3 , | 68 | .Xr bcmp 3 , |
74 | .Xr memcmp 3 | 69 | .Xr memcmp 3 |