]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Change all one's complement to ones' complement for consistency
authorwillmafh <willmafh@hotmail.com>
Tue, 3 Dec 2024 05:13:39 +0000 (13:13 +0800)
committerTomas Mraz <tomas@openssl.org>
Fri, 6 Dec 2024 14:26:36 +0000 (15:26 +0100)
CLA: trivial

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26095)

crypto/asn1/a_int.c
crypto/modes/siv128.c
include/internal/numbers.h
include/internal/sockets.h
providers/implementations/kdfs/krb5kdf.c
test/bioprinttest.c

index dc962290dda7b7be1d830e8d338df4ee4639349e..7d5dd85fc044ec1ac30d830112b9a77761dd7999 100644 (file)
@@ -265,7 +265,7 @@ static int asn1_get_int64(int64_t *pr, const unsigned char *b, size_t blen,
             *pr = -(int64_t)r;
         } else if (r == ABS_INT64_MIN) {
             /* This never happens if INT64_MAX == ABS_INT64_MIN, e.g.
-             * on ones'-complement system. */
+             * on ones' complement system. */
             *pr = (int64_t)(0 - r);
         } else {
             ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
@@ -347,8 +347,8 @@ static int asn1_string_set_int64(ASN1_STRING *a, int64_t r, int itype)
     if (r < 0) {
         /* Most obvious '-r' triggers undefined behaviour for most
          * common INT64_MIN. Even though below '0 - (uint64_t)r' can
-         * appear two's-complement centric, it does produce correct/
-         * expected result even on one's-complement. This is because
+         * appear two's complement centric, it does produce correct/
+         * expected result even on ones' complement. This is because
          * cast to unsigned has to change bit pattern... */
         off = asn1_put_uint64(tbuf, 0 - (uint64_t)r);
         a->type |= V_ASN1_NEG;
index e6348a8d3753cc818ea681616d43f0880f1d0616..19bc5158523a4207090a84a7b10bb3c395e14b75 100644 (file)
@@ -69,7 +69,7 @@ static ossl_inline void siv128_xorblock(SIV_BLOCK *x,
  * Doubles |b|, which is 16 bytes representing an element
  * of GF(2**128) modulo the irreducible polynomial
  * x**128 + x**7 + x**2 + x + 1.
- * Assumes two's-complement arithmetic
+ * Assumes two's complement arithmetic
  */
 static ossl_inline void siv128_dbl(SIV_BLOCK *b)
 {
index 47fb167709f52ca043b3e9bf2fb8ad199312e10f..4a93a247563753d95af96cff0619195527393be1 100644 (file)
@@ -19,7 +19,7 @@
 #  define __MAXINT__(T) ((T) ((((T) 1) << ((sizeof(T) * CHAR_BIT) - 1)) ^ __MAXUINT__(T)))
 #  define __MININT__(T) (-__MAXINT__(T) - 1)
 
-# elif (-1 & 3) == 0x02         /* One's complement */
+# elif (-1 & 3) == 0x02         /* Ones' complement */
 
 #  define __MAXUINT__(T) (((T) -1) + 1)
 #  define __MAXINT__(T) ((T) ((((T) 1) << ((sizeof(T) * CHAR_BIT) - 1)) ^ __MAXUINT__(T)))
index 11e21508fe0f6590f4ee3c7b650cc121f75949e5..d10ef67cc1b6d9aebc946ae11940c2702221deea 100644 (file)
@@ -54,7 +54,7 @@ struct servent *PASCAL getservbyname(const char *, const char *);
  * Even though sizeof(SOCKET) is 8, it's safe to cast it to int, because
  * the value constitutes an index in per-process table of limited size
  * and not a real pointer. And we also depend on fact that all processors
- * Windows run on happen to be two's-complement, which allows to
+ * Windows run on happen to be two's complement, which allows to
  * interchange INVALID_SOCKET and -1.
  */
 #   define socket(d,t,p)   ((int)socket(d,t,p))
index 719b45415c062ecf27833863dffab0d16a47ac53..07f14b4282c341c2fc31bfa051b506b4cea0c344 100644 (file)
@@ -275,7 +275,7 @@ static int fixup_des3_key(unsigned char *key)
  *
  * block = 0
  * for k: 1 -> K
- *   block += s[N(k-1)..(N-1)k] (one's complement addition)
+ *   block += s[N(k-1)..(N-1)k] (ones' complement addition)
  *
  * Optimizing for space we compute:
  * for each l in L-1 -> 0:
index ff5e8a05a7816bea2b5716616870b993962c729e..5ac5025c40e830f434ca2ab194c82f8d660d218b 100644 (file)
@@ -149,7 +149,7 @@ static j_data jf_data[] = {
     { 0xffffffffffffffffULL, "%jx", "ffffffffffffffff" },
     { 0x8000000000000000ULL, "%ju", "9223372036854775808" },
     /*
-     * These tests imply two's-complement, but it's the only binary
+     * These tests imply two's complement, but it's the only binary
      * representation we support, see test/sanitytest.c...
      */
     { 0x8000000000000000ULL, "%ji", "-9223372036854775808" },