Print this page
6799218 RSA using Solaris Kernel Crypto framework lagging behind OpenSSL
5016936 bignumimpl:big_mul: potential memory leak
6810280 panic from bignum module: vmem_xalloc(): size == 0

@@ -1,12 +1,11 @@
 /*
  * CDDL HEADER START
  *
  * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
  *
  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  * or http://www.opensolaris.org/os/licensing.
  * See the License for the specific language governing permissions
  * and limitations under the License.

@@ -18,20 +17,18 @@
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * CDDL HEADER END
  */
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 /*
  * If compiled without -DRF_INLINE_MACROS then needs -lm at link time
  * If compiled with -DRF_INLINE_MACROS then needs conv.il at compile time
- * (i.e. cc <compileer_flags> -DRF_INLINE_MACROS conv.il mont_mulf.c )
+ * (i.e. cc <compiler_flags> -DRF_INLINE_MACROS conv.il mont_mulf.c )
  */
 
 #include <sys/types.h>
 #include <math.h>
 

@@ -92,14 +89,14 @@
 
 void
 conv_d16_to_i32(uint32_t *i32, double *d16, int64_t *tmp, int ilen)
 {
         int i;
-        int64_t t, t1,          /* using int64_t and not uint64_t */
+        int64_t t, t1,          /* Using int64_t and not uint64_t */
                 a, b, c, d;     /* because more efficient code is */
                                 /* generated this way, and there  */
-                                /* is no overflow  */
+                                /* is no overflow.  */
         t1 = 0;
         a = (int64_t)d16[0];
         b = (int64_t)d16[1];
         for (i = 0; i < ilen - 1; i++) {
                 c = (int64_t)d16[2 * i + 2];

@@ -199,12 +196,11 @@
         uint32_t a;
 
 #pragma pipeloop(0)
         for (i = 0; i < len - 3; i += 4) {
                 i16_to_d16_and_d32x4(&TwoToMinus16, &TwoTo16, &Zero,
-                                        &(d16[2*i]), &(d32[i]),
-                                        (float *)(&(i32[i])));
+                    &(d16[2*i]), &(d32[i]), (float *)(&(i32[i])));
         }
         for (; i < len; i++) {
                 a = i32[i];
                 d32[i] = (double)(i32[i]);
                 d16[2 * i] = (double)(a & 0xffff);

@@ -324,11 +320,11 @@
                         pdtj[22] += pdm1[11] *m2j + pdn[11] * digit;
                         pdtj[24] += pdm1[12] *m2j + pdn[12] * digit;
                         pdtj[26] += pdm1[13] *m2j + pdn[13] * digit;
                         pdtj[28] += pdm1[14] *m2j + pdn[14] * digit;
                         pdtj[30] += pdm1[15] *m2j + pdn[15] * digit;
-                        /* no need for cleenup, cannot overflow */
+                        /* no need for cleanup, cannot overflow */
                         digit = mod(lower32(b, Zero) * dn0,
                                     TwoToMinus16, TwoTo16);
                 }
         }