---
name: "libressl-BN_zero"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-BN_zero"
---

# libressl-BN\_zero(3)

BIGNUM assignment operations

## NAME

**BN\_zero**, **BN\_one**, **BN\_value\_one**, **BN\_set\_word**, **BN\_get\_word** – BIGNUM assignment operations

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/bn.h\>**

*void*\

**BN\_zero**(*BIGNUM \*a*);

*int*\

**BN\_one**(*BIGNUM \*a*);

*const* *BIGNUM* *\**\

**BN\_value\_one**(*void*);

*int*\

**BN\_set\_word**(*BIGNUM \*a*, *BN\_ULONG w*);

*BN\_ULONG*\

**BN\_get\_word**(*const BIGNUM \*a*);

## DESCRIPTION

*BN\_ULONG* is a macro that expands to an unsigned integral type optimized for the most efficient implementation on the local platform. It is *unsigned* *long* (= *uint64\_t*) on \_LP64 platforms and *unsigned* *int* (= *uint32\_t*) elsewhere.

**BN\_zero**(), **BN\_one**(), and **BN\_set\_word**() set *a* to the values 0, 1 and *w* respectively.

**BN\_value\_one**() returns a *BIGNUM* constant of value 1. This constant is useful for comparisons and assignments.

## RETURN VALUES

**BN\_get\_word**() returns the value *a*, or (BN\_ULONG)-1 if *a* cannot be represented as a *BN\_ULONG*.

**BN\_one**() and **BN\_set\_word**() return 1 on success, 0 otherwise. **BN\_value\_one**() returns the constant.

## SEE ALSO

BN\_bn2bin(3), BN\_new(3), BN\_set\_bit(3), BN\_set\_negative(3)

## HISTORY

**BN\_zero**(), **BN\_one**(), **BN\_value\_one**(), and **BN\_set\_word**() first appeared in SSLeay 0.5.1. **BN\_get\_word**() first appeared in SSLeay 0.6.0. These functions have been available since OpenBSD 2.4.

## BUGS

Someone might change the constant.

If the value of a *BIGNUM* is equal to a *BN\_ULONG* with all bits set, the return value of **BN\_get\_word**() collides with return value used to indicate errors.

*BN\_ULONG* should probably be a typedef rather than a macro.
