1.\" $OpenBSD: BN_set_negative.3,v 1.3 2016/12/10 21:13:25 schwarze Exp $ 2.\" 3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> 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.\" 17.Dd $Mdocdate: December 10 2016 $ 18.Dt BN_SET_NEGATIVE 3 19.Os 20.Sh NAME 21.Nm BN_set_negative , 22.Nm BN_is_negative 23.Nd change and inspect the sign of a BIGNUM 24.Sh SYNOPSIS 25.Ft void 26.Fo BN_set_negative 27.Fa "BIGNUM *b" 28.Fa "int n" 29.Fc 30.Ft int 31.Fo BN_is_negative 32.Fa "const BIGNUM *b" 33.Fc 34.Sh DESCRIPTION 35.Fn BN_set_negative 36sets 37.Fa b 38to negative if both 39.Fa b 40and 41.Fa n 42are non-zero, otherwise it sets it to positive. 43.Pp 44.Fn BN_is_negative 45tests the sign of 46.Fa b . 47It is currently implemented as a macro. 48.Sh RETURN VALUES 49.Fn BN_is_negative 50returns 1 if 51.Fa b 52is negative or 0 otherwise. 53.Sh SEE ALSO 54.Xr BN_add 3 , 55.Xr BN_new 3 , 56.Xr BN_set_bit 3 , 57.Xr BN_zero 3 58