-.\" $OpenBSD: BN_zero.3,v 1.6 2016/12/10 21:13:25 schwarze Exp $
-.\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400
+.\" $OpenBSD: BN_zero.3,v 1.7 2018/02/13 02:39:29 schwarze Exp $
+.\" full merge up to: OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400
+.\" selective merge up to: OpenSSL b713c4ff Jan 22 14:41:09 2018 -0500
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
-.\" Copyright (c) 2000, 2001, 2002 The OpenSSL Project. All rights reserved.
+.\" Copyright (c) 2000, 2001, 2002, 2018 The OpenSSL Project.
+.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: December 10 2016 $
+.Dd $Mdocdate: February 13 2018 $
.Dt BN_ZERO 3
.Os
.Sh NAME
.Ft int
.Fo BN_set_word
.Fa "BIGNUM *a"
-.Fa "unsigned long w"
+.Fa "BN_ULONG w"
.Fc
-.Ft unsigned long
+.Ft BN_ULONG
.Fo BN_get_word
.Fa "BIGNUM *a"
.Fc
.Sh DESCRIPTION
+.Vt BN_ULONG
+is a macro that expands to an unsigned integral type optimized
+for the most efficient implementation on the local platform.
+.Pp
.Fn BN_zero ,
.Fn BN_one ,
and
returns a
.Vt BIGNUM
constant of value 1.
-This constant is useful for use in comparisons and assignment.
-.Pp
-.Fn BN_get_word
-returns
-.Fa a
-if it can be represented as an
-.Vt unsigned long .
+This constant is useful for comparisons and assignments.
.Sh RETURN VALUES
.Fn BN_get_word
returns the value
.Fa a ,
-or 0xffffffffL if
+or a number with all bits set if
.Fa a
-cannot be represented as an
-.Vt unsigned long .
+cannot be represented as a
+.Vt BN_ULONG .
.Pp
.Fn BN_zero ,
.Fn BN_one ,
.Sh BUGS
Someone might change the constant.
.Pp
-If a
+If the value of a
.Vt BIGNUM
-is equal to 0xffffffffL; it can be represented as an
-.Vt unsigned long
-but this value is also returned on error.
+is equal to a
+.Vt BN_ULONG
+with all bits set, the return value of
+.Fn BN_get_word
+collides with return value used to indicate errors.
+.Pp
+.Vt BN_ULONG
+should probably be a typedef rather than a macro.