freeswitch/libs/libzrtp/third_party/bnlib/lbn68020.h

33 lines
1.2 KiB
C
Raw Permalink Normal View History

2010-02-20 18:51:54 +00:00
/*
* Copyright (c) 1995 Colin Plumb. All rights reserved.
* For licensing and other legal details, see the file legal.c.
*
2010-02-20 18:51:54 +00:00
* lbn68020.h - 32-bit bignum primitives for the 68020 (or 683xx) processors.
*
* These primitives use little-endian word order.
* (The order of bytes within words is irrelevant.)
*/
#define BN_LITTLE_ENDIAN 1
typedef unsigned long bnword32;
#define BNWORD32 bnword32
bnword32 lbnSub1_32(bnword32 *num, unsigned len, bnword32 borrow);
bnword32 lbnAdd1_32(bnword32 *num, unsigned len, bnword32 carry);
void lbnMulN1_32(bnword32 *out, bnword32 const *in, unsigned len, bnword32 k);
bnword32
lbnMulAdd1_32(bnword32 *out, bnword32 const *in, unsigned len, bnword32 k);
bnword32
lbnMulSub1_32(bnword32 *out, bnword32 const *in, unsigned len, bnword32 k);
bnword32 lbnDiv21_32(bnword32 *q, bnword32 nh, bnword32 nl, bnword32 d);
unsigned lbnModQ_32(bnword32 const *n, unsigned len, unsigned d);
/* #define the values to exclude the C versions */
#define lbnSub1_32 lbnSub1_32
#define lbnAdd1_32 lbnAdd1_32
#define lbnMulN1_32 lbnMulN1_32
#define lbnMulAdd1_32 lbnMulAdd1_32
#define lbnMulSub1_32 lbnMulSub1_32
#define lbnDiv21_32 lbnDiv21_32
#define lbnModQ_32 lbnModQ_32