manpagez: man pages & more
info gcrypt
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12.6 Bit manipulations

There are a couple of functions to get information on arbitrary bits in an MPI and to set or clear them:

Function: unsigned int gcry_mpi_get_nbits (gcry_mpi_t a)

Return the number of bits required to represent a.

Function: int gcry_mpi_test_bit (gcry_mpi_t a, unsigned int n)

Return true if bit number n (counting from 0) is set in a.

Function: void gcry_mpi_set_bit (gcry_mpi_t a, unsigned int n)

Set bit number n in a.

Function: void gcry_mpi_clear_bit (gcry_mpi_t a, unsigned int n)

Clear bit number n in a.

Function: void gcry_mpi_set_highbit (gcry_mpi_t a, unsigned int n)

Set bit number n in a and clear all bits greater than n.

Function: void gcry_mpi_clear_highbit (gcry_mpi_t a, unsigned int n)

Clear bit number n in a and all bits greater than n.

Function: void gcry_mpi_rshift (gcry_mpi_t x, gcry_mpi_t a, unsigned int n)

Shift the value of a by n bits to the right and store the result in x.

Function: void gcry_mpi_lshift (gcry_mpi_t x, gcry_mpi_t a, unsigned int n)

Shift the value of a by n bits to the left and store the result in x.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on February 9, 2014 using texi2html 5.0.

© manpagez.com 2000-2018
Individual documents may contain additional copyright information.