1 /* $NetBSD: bn_mp_and.c,v 1.1.1.2 2014/04/24 12:45:31 pettai Exp $ */
5 /* LibTomMath, multiple-precision integer library -- Tom St Denis
7 * LibTomMath is a library that provides multiple-precision
8 * integer arithmetic as well as number theoretic functionality.
10 * The library was designed directly after the MPI library by
11 * Michael Fromberger but has been written from scratch with
12 * additional optimizations in place.
14 * The library is free for all purposes without any express
17 * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
20 /* AND two ints together */
22 mp_and (mp_int
* a
, mp_int
* b
, mp_int
* c
)
27 if (a
->used
> b
->used
) {
28 if ((res
= mp_init_copy (&t
, a
)) != MP_OKAY
) {
34 if ((res
= mp_init_copy (&t
, b
)) != MP_OKAY
) {
41 for (ix
= 0; ix
< px
; ix
++) {
42 t
.dp
[ix
] &= x
->dp
[ix
];
45 /* zero digits above the last from the smallest mp_int */
46 for (; ix
< t
.used
; ix
++) {
57 /* Source: /cvs/libtom/libtommath/bn_mp_and.c,v */
59 /* Date: 2006/12/28 01:25:13 */