2
0

lbn68020.h 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 1995 Colin Plumb. All rights reserved.
  3. * For licensing and other legal details, see the file legal.c.
  4. *
  5. * lbn68020.h - 32-bit bignum primitives for the 68020 (or 683xx) processors.
  6. *
  7. * These primitives use little-endian word order.
  8. * (The order of bytes within words is irrelevant.)
  9. */
  10. #define BN_LITTLE_ENDIAN 1
  11. typedef unsigned long bnword32;
  12. #define BNWORD32 bnword32
  13. bnword32 lbnSub1_32(bnword32 *num, unsigned len, bnword32 borrow);
  14. bnword32 lbnAdd1_32(bnword32 *num, unsigned len, bnword32 carry);
  15. void lbnMulN1_32(bnword32 *out, bnword32 const *in, unsigned len, bnword32 k);
  16. bnword32
  17. lbnMulAdd1_32(bnword32 *out, bnword32 const *in, unsigned len, bnword32 k);
  18. bnword32
  19. lbnMulSub1_32(bnword32 *out, bnword32 const *in, unsigned len, bnword32 k);
  20. bnword32 lbnDiv21_32(bnword32 *q, bnword32 nh, bnword32 nl, bnword32 d);
  21. unsigned lbnModQ_32(bnword32 const *n, unsigned len, unsigned d);
  22. /* #define the values to exclude the C versions */
  23. #define lbnSub1_32 lbnSub1_32
  24. #define lbnAdd1_32 lbnAdd1_32
  25. #define lbnMulN1_32 lbnMulN1_32
  26. #define lbnMulAdd1_32 lbnMulAdd1_32
  27. #define lbnMulSub1_32 lbnMulSub1_32
  28. #define lbnDiv21_32 lbnDiv21_32
  29. #define lbnModQ_32 lbnModQ_32