lbnppc.h
上传用户:zbbssh
上传日期:2007-01-08
资源大小:196k
文件大小:1k
源码类别:

CA认证

开发平台:

C/C++

  1. #ifndef LBNPPC_H
  2. #define LBNPPC_H
  3. /*
  4.  * Assembly-language routines for the Power PC processor.
  5.  * Annoyingly, the Power PC does not have 64/32->32 bit divide,
  6.  * so the C code should be reasonably fast.  But it does have
  7.  * 32x32->64-bit multiplies, and these routines provide access
  8.  * to that.
  9.  */
  10. /*
  11.  * Bignums are stored in arrays of 32-bit words, and the least
  12.  * significant 32-bit word has the lowest address, thus "little-endian".
  13.  * The C code is slightly more efficient this way, so unless the
  14.  * processor cares (the PowerPC, like most RISCs, doesn't), it is
  15.  * best to use BN_LITTLE_ENDIAN.
  16.  * Note that this has NOTHING to do with the order of bytes within a 32-bit
  17.  * word; the math library is insensitive to that.
  18.  */
  19. #define BN_LITTLE_ENDIAN 1
  20. /* Shared transition vector array */
  21. extern unsigned const * const lbnPPC_tv[];
  22. /* A function pointer on the PowerPC is a pointer to a transition vector */
  23. #define lbnMulN1_32 
  24. ((void (*)(unsigned *, unsigned const *, unsigned, unsigned))(lbnPPC_tv+0))
  25. #define lbnMulAdd1_32 
  26. ((unsigned (*)(unsigned *, unsigned const *, unsigned, unsigned))(lbnPPC_tv+1))
  27. #define lbnMulSub1_32 
  28. ((unsigned (*)(unsigned *, unsigned const *, unsigned, unsigned))(lbnPPC_tv+2))
  29. #endif