diff libtomcrypt/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c @ 1471:6dba84798cd5

Update to libtomcrypt 1.18.1, merged with Dropbear changes
author Matt Johnston <matt@ucc.asn.au>
date Fri, 09 Feb 2018 21:44:05 +0800
parents f849a5ca2efc
children
line wrap: on
line diff
--- a/libtomcrypt/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c	Thu Feb 08 23:11:40 2018 +0800
+++ b/libtomcrypt/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c	Fri Feb 09 21:44:05 2018 +0800
@@ -5,8 +5,6 @@
  *
  * The library is free for all purposes without any express
  * guarantee it works.
- *
- * Tom St Denis, [email protected], http://libtom.org
  */
 #include "tomcrypt.h"
 
@@ -55,7 +53,7 @@
    }
 
    /* store header + length */
-   x = 0; 
+   x = 0;
    out[x++] = 0x06;
    if (z < 128) {
       out[x++] = (unsigned char)z;
@@ -71,33 +69,33 @@
    }
 
    /* store first byte */
-    wordbuf = words[0] * 40 + words[1];   
-    for (i = 1; i < nwords; i++) {
-        /* store 7 bit words in little endian */
-        t    = wordbuf & 0xFFFFFFFF;
-        if (t) {
-           y    = x;
-           mask = 0;
-           while (t) {
-               out[x++] = (unsigned char)((t & 0x7F) | mask);
-               t    >>= 7;
-               mask  |= 0x80;  /* upper bit is set on all but the last byte */
-           }
-           /* now swap bytes y...x-1 */
-           z = x - 1;
-           while (y < z) {
-               t = out[y]; out[y] = out[z]; out[z] = (unsigned char)t;
-               ++y; 
-               --z;
-           }
-       } else {
-          /* zero word */
-          out[x++] = 0x00;
-       }
-       
-       if (i < nwords - 1) {
-          wordbuf = words[i + 1];
-       }
+   wordbuf = words[0] * 40 + words[1];
+   for (i = 1; i < nwords; i++) {
+      /* store 7 bit words in little endian */
+      t    = wordbuf & 0xFFFFFFFF;
+      if (t) {
+         y    = x;
+         mask = 0;
+         while (t) {
+            out[x++] = (unsigned char)((t & 0x7F) | mask);
+            t    >>= 7;
+            mask  |= 0x80;  /* upper bit is set on all but the last byte */
+         }
+         /* now swap bytes y...x-1 */
+         z = x - 1;
+         while (y < z) {
+            t = out[y]; out[y] = out[z]; out[z] = (unsigned char)t;
+            ++y;
+            --z;
+         }
+      } else {
+         /* zero word */
+         out[x++] = 0x00;
+      }
+
+      if (i < nwords - 1) {
+         wordbuf = words[i + 1];
+      }
    }
 
    *outlen = x;
@@ -106,6 +104,6 @@
 
 #endif
 
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
+/* ref:         $Format:%D$ */
+/* git commit:  $Format:%H$ */
+/* commit time: $Format:%ai$ */