=pod =head1 NAME BN_set_bit, BN_clear_bit, BN_is_bit_set, BN_mask_bits, BN_lshift, BN_lshift1, BN_rshift, BN_rshift1 - bit operations on BIGNUMs =head1 SYNOPSIS #include int BN_set_bit(BIGNUM *a, int n); int BN_clear_bit(BIGNUM *a, int n); int BN_is_bit_set(const BIGNUM *a, int n); int BN_mask_bits(BIGNUM *a, int n); int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); int BN_lshift1(BIGNUM *r, BIGNUM *a); int BN_rshift(BIGNUM *r, BIGNUM *a, int n); int BN_rshift1(BIGNUM *r, BIGNUM *a); =head1 DESCRIPTION BN_set_bit() sets bit B in B to 1 (CEn)>). The number is expanded if necessary. BN_clear_bit() sets bit B in B to 0 (CEn)>). An error occurs if B is shorter than B bits. BN_is_bit_set() tests if bit B in B is set. BN_mask_bits() truncates B to an B bit number (CEn)>). An error occurs if B is negative. An error is also returned if the internal representation of B is already shorter than B bits. The internal representation depends on the platform's word size, and this error can be safely ignored. Use L to determine the exact number of bits if needed. BN_lshift() shifts B left by B bits and places the result in B (C). Note that B must be nonnegative. BN_lshift1() shifts B left by one and places the result in B (C). BN_rshift() shifts B right by B bits and places the result in B (C). Note that B must be nonnegative. BN_rshift1() shifts B right by one and places the result in B (C). For the shift functions, B and B may be the same variable. =head1 RETURN VALUES BN_is_bit_set() returns 1 if the bit is set, 0 otherwise. All other functions return 1 for success, 0 on error. The error codes can be obtained by L. =head1 SEE ALSO L, L =head1 COPYRIGHT Copyright 2000-2024 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at L. =cut