]>
git.ipfire.org Git - thirdparty/freeswitch.git/blob - libs/libzrtp/third_party/bnlib/lbn68000.h
2 * Copyright (c) 1995 Colin Plumb. All rights reserved.
3 * For licensing and other legal details, see the file legal.c.
5 * lbn68000.h - 16-bit bignum primitives for the 68000 (or 68010) processors.
7 * These primitives use little-endian word order.
8 * (The order of bytes within words is irrelevant.)
10 #define BN_LITTLE_ENDIAN 1
12 typedef unsigned short bnword16
13 #define BNWORD16 bnword16
15 bnword16
lbnSub1_16(bnword16
*num
, unsigned len
, bnword16 borrow
);
16 bnword16
lbnAdd1_16(bnword16
*num
, unsigned len
, bnword16 carry
);
17 void lbnMulN1_16(bnword16
*out
, bnword16
const *in
, unsigned len
, bnword16 k
);
19 lbnMulAdd1_16(bnword16
*out
, bnword16
const *in
, unsigned len
, bnword16 k
);
21 lbnMulSub1_16(bnword16
*out
, bnword16
const *in
, unsigned len
, bnword16 k
);
22 bnword16
lbnDiv21_16(bnword16
*q
, bnword16 nh
, bnword16 nl
, bnword16 d
);
23 unsigned lbnModQ_16(bnword16
const *n
, unsigned len
, bnword16 d
);
27 /* #define the values to exclude the C versions */
28 #define lbnSub1_16 lbnSub1_16
29 #define lbnAdd1_16 lbnAdd1_16
30 #define lbnMulN1_16 lbnMulN1_16
31 #define lbnMulAdd1_16 lbnMulAdd1_16
32 #define lbnMulSub1_16 lbnMulSub1_16
33 #define lbnDiv21_16 lbnDiv21_16
34 #define lbnModQ_16 lbnModQ_16
36 /* Also include the 68020 definitions for 16/32 bit switching versions. */