diff options
| author | cvs2svn <admin@example.com> | 2021-08-18 16:06:57 +0000 |
|---|---|---|
| committer | cvs2svn <admin@example.com> | 2021-08-18 16:06:57 +0000 |
| commit | d56c8fa8260d226f98b26f017b45b9c2b135f38d (patch) | |
| tree | 348178b41617813cc93787187984a734ef8379ca /src/lib/libc/string/timingsafe_bcmp.3 | |
| parent | 18b9c1bcab7c37d8c5bd05b8e0d14d0c59d96650 (diff) | |
| download | openbsd-tb_20210818.tar.gz openbsd-tb_20210818.tar.bz2 openbsd-tb_20210818.zip | |
This commit was manufactured by cvs2git to create tag 'tb_20210818'.tb_20210818
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/string/timingsafe_bcmp.3 | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/src/lib/libc/string/timingsafe_bcmp.3 b/src/lib/libc/string/timingsafe_bcmp.3 deleted file mode 100644 index 00da769157..0000000000 --- a/src/lib/libc/string/timingsafe_bcmp.3 +++ /dev/null | |||
| @@ -1,87 +0,0 @@ | |||
| 1 | .\" $OpenBSD: timingsafe_bcmp.3,v 1.2 2014/06/21 20:22:15 tedu Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 2014 Google Inc. | ||
| 4 | .\" | ||
| 5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 7 | .\" copyright notice and this permission notice appear in all copies. | ||
| 8 | .\" | ||
| 9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 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 | ||
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | .Dd $Mdocdate: June 21 2014 $ | ||
| 17 | .Dt TIMINGSAFE_BCMP 3 | ||
| 18 | .Os | ||
| 19 | .Sh NAME | ||
| 20 | .Nm timingsafe_bcmp , | ||
| 21 | .Nm timingsafe_memcmp | ||
| 22 | .Nd timing-safe byte sequence comparisons | ||
| 23 | .Sh SYNOPSIS | ||
| 24 | .In string.h | ||
| 25 | .Ft int | ||
| 26 | .Fn timingsafe_bcmp "const void *b1" "const void *b2" "size_t len" | ||
| 27 | .Ft int | ||
| 28 | .Fn timingsafe_memcmp "const void *b1" "const void *b2" "size_t len" | ||
| 29 | .Sh DESCRIPTION | ||
| 30 | The | ||
| 31 | .Fn timingsafe_bcmp | ||
| 32 | and | ||
| 33 | .Fn timingsafe_memcmp | ||
| 34 | functions lexicographically compare the first | ||
| 35 | .Fa len | ||
| 36 | bytes (each interpreted as an | ||
| 37 | .Vt unsigned char ) | ||
| 38 | pointed to by | ||
| 39 | .Fa b1 | ||
| 40 | and | ||
| 41 | .Fa b2 . | ||
| 42 | .Pp | ||
| 43 | Additionally, their running times are independent of the byte sequences compared, | ||
| 44 | making them safe to use for comparing secret values such as cryptographic MACs. | ||
| 45 | In contrast, | ||
| 46 | .Xr bcmp 3 | ||
| 47 | and | ||
| 48 | .Xr memcmp 3 | ||
| 49 | may short-circuit after finding the first differing byte. | ||
| 50 | .Sh RETURN VALUES | ||
| 51 | The | ||
| 52 | .Fn timingsafe_bcmp | ||
| 53 | function returns 0 or not zero if the byte sequence pointed to by | ||
| 54 | .Fa b1 | ||
| 55 | compares equal to or not equal to (respectively) | ||
| 56 | the byte sequence pointed to by | ||
| 57 | .Fa b2 . | ||
| 58 | .Pp | ||
| 59 | The | ||
| 60 | .Fn timingsafe_memcmp | ||
| 61 | function returns a negative value, 0, or positive value if the byte sequence | ||
| 62 | pointed to by | ||
| 63 | .Fa b1 | ||
| 64 | compares less than, equal to, or greater than (respectively) | ||
| 65 | the byte sequence pointed to by | ||
| 66 | .Fa b2 . | ||
| 67 | .Sh SEE ALSO | ||
| 68 | .Xr bcmp 3 , | ||
| 69 | .Xr memcmp 3 | ||
| 70 | .Sh STANDARDS | ||
| 71 | The | ||
| 72 | .Fn timingsafe_bcmp | ||
| 73 | and | ||
| 74 | .Fn timingsafe_memcmp | ||
| 75 | functions are | ||
| 76 | .Ox | ||
| 77 | extensions. | ||
| 78 | .Sh HISTORY | ||
| 79 | The | ||
| 80 | .Fn timingsafe_bcmp | ||
| 81 | function first appeared in | ||
| 82 | .Ox 4.9 . | ||
| 83 | .Pp | ||
| 84 | The | ||
| 85 | .Fn timingsafe_memcmp | ||
| 86 | function first appeared in | ||
| 87 | .Ox 5.6 . | ||
