Print this page
4853 illumos-gate is not lint-clean when built with openssl 1.0

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/openssl/libsunw_crypto/bn/bn_div.c
          +++ new/usr/src/lib/openssl/libsunw_crypto/bn/bn_div.c
↓ open down ↓ 50 lines elided ↑ open up ↑
  51   51   * SUCH DAMAGE.
  52   52   *
  53   53   * The licence and distribution terms for any publically available version or
  54   54   * derivative of this code cannot be changed.  i.e. this code cannot simply be
  55   55   * copied and put under another distribution licence
  56   56   * [including the GNU Public Licence.]
  57   57   */
  58   58  
  59   59  #include <stdio.h>
  60   60  #include <openssl/bn.h>
  61      -#include "cryptlib.h"
  62      -#include "bn_lcl.h"
       61 +#include <cryptlib.h>
       62 +#include <bn_lcl.h>
  63   63  
  64   64  
  65   65  /* The old slow way */
  66   66  #if 0
  67   67  int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
  68   68             BN_CTX *ctx)
  69   69          {
  70   70          int i,nm,nd;
  71   71          int ret = 0;
  72   72          BIGNUM *D;
↓ open down ↓ 63 lines elided ↑ open up ↑
 136  136      * - GNU C generates a call to a function (__udivdi3 to be exact)
 137  137      *   in reply to ((((BN_ULLONG)n0)<<BN_BITS2)|n1)/d0 (I fail to
 138  138      *   understand why...);
 139  139      * - divl doesn't only calculate quotient, but also leaves
 140  140      *   remainder in %edx which we can definitely use here:-)
 141  141      *
 142  142      *                                   <appro@fy.chalmers.se>
 143  143      */
 144  144  #undef bn_div_words
 145  145  #  define bn_div_words(n0,n1,d0)                \
 146      -        ({  asm volatile (                      \
      146 +        ({  __asm volatile (                    \
 147  147                  "divl   %4"                     \
 148  148                  : "=a"(q), "=d"(rem)            \
 149  149                  : "a"(n1), "d"(n0), "g"(d0)     \
 150  150                  : "cc");                        \
 151  151              q;                                  \
 152  152          })
 153  153  #  define REMAINDER_IS_ALREADY_CALCULATED
 154  154  #  elif defined(__x86_64) && defined(SIXTY_FOUR_BIT_LONG)
 155  155     /*
 156  156      * Same story here, but it's 128-bit by 64-bit division. Wow!
 157  157      *                                   <appro@fy.chalmers.se>
 158  158      */
 159  159  #  undef bn_div_words
 160  160  #  define bn_div_words(n0,n1,d0)                \
 161      -        ({  asm volatile (                      \
      161 +        ({  __asm volatile (                    \
 162  162                  "divq   %4"                     \
 163  163                  : "=a"(q), "=d"(rem)            \
 164  164                  : "a"(n1), "d"(n0), "g"(d0)     \
 165  165                  : "cc");                        \
 166  166              q;                                  \
 167  167          })
 168  168  #  define REMAINDER_IS_ALREADY_CALCULATED
 169  169  #  endif /* __<cpu> */
 170  170  # endif /* __GNUC__ */
 171  171  #endif /* OPENSSL_NO_ASM */
↓ open down ↓ 277 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX