Run the comment converter on libcrypto.

crypto/{asn1,x509,x509v3,pem} were skipped as they are still OpenSSL
style.

Change-Id: I3cd9a60e1cb483a981aca325041f3fbce294247c
Reviewed-on: https://boringssl-review.googlesource.com/19504
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/crypto/fipsmodule/ecdsa/ecdsa.c b/crypto/fipsmodule/ecdsa/ecdsa.c
index c061ab8..dfa3b67 100644
--- a/crypto/fipsmodule/ecdsa/ecdsa.c
+++ b/crypto/fipsmodule/ecdsa/ecdsa.c
@@ -64,16 +64,16 @@
 #include "../../internal.h"
 
 
-/* digest_to_bn interprets |digest_len| bytes from |digest| as a big-endian
- * number and sets |out| to that value. It then truncates |out| so that it's,
- * at most, as long as |order|. It returns one on success and zero otherwise. */
+// digest_to_bn interprets |digest_len| bytes from |digest| as a big-endian
+// number and sets |out| to that value. It then truncates |out| so that it's,
+// at most, as long as |order|. It returns one on success and zero otherwise.
 static int digest_to_bn(BIGNUM *out, const uint8_t *digest, size_t digest_len,
                         const BIGNUM *order) {
   size_t num_bits;
 
   num_bits = BN_num_bits(order);
-  /* Need to truncate digest if it is too long: first truncate whole
-   * bytes. */
+  // Need to truncate digest if it is too long: first truncate whole
+  // bytes.
   if (8 * digest_len > num_bits) {
     digest_len = (num_bits + 7) / 8;
   }
@@ -82,7 +82,7 @@
     return 0;
   }
 
-  /* If still too long truncate remaining bits with a shift */
+  // If still too long truncate remaining bits with a shift
   if ((8 * digest_len > num_bits) &&
       !BN_rshift(out, out, 8 - (num_bits & 0x7))) {
     OPENSSL_PUT_ERROR(ECDSA, ERR_R_BN_LIB);
@@ -130,7 +130,7 @@
   const EC_GROUP *group;
   const EC_POINT *pub_key;
 
-  /* check input values */
+  // check input values
   if ((group = EC_KEY_get0_group(eckey)) == NULL ||
       (pub_key = EC_KEY_get0_public_key(eckey)) == NULL ||
       sig == NULL) {
@@ -160,7 +160,7 @@
     OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE);
     goto err;
   }
-  /* calculate tmp1 = inv(S) mod order */
+  // calculate tmp1 = inv(S) mod order
   int no_inverse;
   if (!BN_mod_inverse_odd(u2, &no_inverse, sig->s, order, ctx)) {
     OPENSSL_PUT_ERROR(ECDSA, ERR_R_BN_LIB);
@@ -169,12 +169,12 @@
   if (!digest_to_bn(m, digest, digest_len, order)) {
     goto err;
   }
-  /* u1 = m * tmp mod order */
+  // u1 = m * tmp mod order
   if (!BN_mod_mul(u1, m, u2, order, ctx)) {
     OPENSSL_PUT_ERROR(ECDSA, ERR_R_BN_LIB);
     goto err;
   }
-  /* u2 = r * w mod q */
+  // u2 = r * w mod q
   if (!BN_mod_mul(u2, sig->r, u2, order, ctx)) {
     OPENSSL_PUT_ERROR(ECDSA, ERR_R_BN_LIB);
     goto err;
@@ -197,7 +197,7 @@
     OPENSSL_PUT_ERROR(ECDSA, ERR_R_BN_LIB);
     goto err;
   }
-  /* if the signature is correct u1 is equal to sig->r */
+  // if the signature is correct u1 is equal to sig->r
   if (BN_ucmp(u1, sig->r) != 0) {
     OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE);
     goto err;
@@ -236,8 +236,8 @@
   }
 
   k = BN_new();
-  kinv = BN_new(); /* this value is later returned in *kinvp */
-  r = BN_new(); /* this value is later returned in *rp    */
+  kinv = BN_new();  // this value is later returned in *kinvp
+  r = BN_new();  // this value is later returned in *rp
   tmp = BN_new();
   if (k == NULL || kinv == NULL || r == NULL || tmp == NULL) {
     OPENSSL_PUT_ERROR(ECDSA, ERR_R_MALLOC_FAILURE);
@@ -251,17 +251,17 @@
 
   const BIGNUM *order = EC_GROUP_get0_order(group);
 
-  /* Check that the size of the group order is FIPS compliant (FIPS 186-4
-   * B.5.2). */
+  // Check that the size of the group order is FIPS compliant (FIPS 186-4
+  // B.5.2).
   if (BN_num_bits(order) < 160) {
     OPENSSL_PUT_ERROR(ECDSA, EC_R_INVALID_GROUP_ORDER);
     goto err;
   }
 
   do {
-    /* If possible, we'll include the private key and message digest in the k
-     * generation. The |digest| argument is only empty if |ECDSA_sign_setup| is
-     * being used. */
+    // If possible, we'll include the private key and message digest in the k
+    // generation. The |digest| argument is only empty if |ECDSA_sign_setup| is
+    // being used.
     if (eckey->fixed_k != NULL) {
       if (!BN_copy(k, eckey->fixed_k)) {
         goto err;
@@ -279,18 +279,18 @@
       goto err;
     }
 
-    /* Compute the inverse of k. The order is a prime, so use Fermat's Little
-     * Theorem. Note |ec_group_get_order_mont| may return NULL but
-     * |bn_mod_inverse_prime| allows this. */
+    // Compute the inverse of k. The order is a prime, so use Fermat's Little
+    // Theorem. Note |ec_group_get_order_mont| may return NULL but
+    // |bn_mod_inverse_prime| allows this.
     if (!bn_mod_inverse_prime(kinv, k, order, ctx,
                               ec_group_get_order_mont(group))) {
       OPENSSL_PUT_ERROR(ECDSA, ERR_R_BN_LIB);
       goto err;
     }
 
-    /* We do not want timing information to leak the length of k,
-     * so we compute G*k using an equivalent scalar of fixed
-     * bit-length. */
+    // We do not want timing information to leak the length of k,
+    // so we compute G*k using an equivalent scalar of fixed
+    // bit-length.
 
     if (!BN_add(k, k, order)) {
       goto err;
@@ -301,7 +301,7 @@
       }
     }
 
-    /* compute r the x-coordinate of generator * k */
+    // compute r the x-coordinate of generator * k
     if (!EC_POINT_mul(group, tmp_point, k, NULL, NULL, ctx)) {
       OPENSSL_PUT_ERROR(ECDSA, ERR_R_EC_LIB);
       goto err;
@@ -318,11 +318,11 @@
     }
   } while (BN_is_zero(r));
 
-  /* clear old values if necessary */
+  // clear old values if necessary
   BN_clear_free(*rp);
   BN_clear_free(*kinvp);
 
-  /* save the pre-computed values  */
+  // save the pre-computed values
   *rp = r;
   *kinvp = kinv;
   ret = 1;
@@ -417,14 +417,14 @@
       goto err;
     }
     if (BN_is_zero(s)) {
-      /* if kinv and r have been supplied by the caller
-       * don't to generate new kinv and r values */
+      // if kinv and r have been supplied by the caller
+      // don't to generate new kinv and r values
       if (in_kinv != NULL && in_r != NULL) {
         OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_NEED_NEW_SETUP_VALUES);
         goto err;
       }
     } else {
-      /* s != 0 => we have a valid signature */
+      // s != 0 => we have a valid signature
       break;
     }
   }
diff --git a/crypto/fipsmodule/ecdsa/ecdsa_test.cc b/crypto/fipsmodule/ecdsa/ecdsa_test.cc
index e1f109b..de4bc48 100644
--- a/crypto/fipsmodule/ecdsa/ecdsa_test.cc
+++ b/crypto/fipsmodule/ecdsa/ecdsa_test.cc
@@ -242,13 +242,13 @@
     SCOPED_TRACE(bits);
     size_t order_len = BitsToBytes(bits);
 
-    /* Create the largest possible |ECDSA_SIG| of the given constraints. */
+    // Create the largest possible |ECDSA_SIG| of the given constraints.
     bssl::UniquePtr<ECDSA_SIG> sig(ECDSA_SIG_new());
     ASSERT_TRUE(sig);
     std::vector<uint8_t> bytes(order_len, 0xff);
     ASSERT_TRUE(BN_bin2bn(bytes.data(), bytes.size(), sig->r));
     ASSERT_TRUE(BN_bin2bn(bytes.data(), bytes.size(), sig->s));
-    /* Serialize it. */
+    // Serialize it.
     uint8_t *der;
     size_t der_len;
     ASSERT_TRUE(ECDSA_SIG_to_bytes(&der, &der_len, sig.get()));