|
@@ -11,6 +11,11 @@
|
|
|
|
|
|
unsigned long der_object_identifier_bits(unsigned long x)
|
|
unsigned long der_object_identifier_bits(unsigned long x)
|
|
{
|
|
{
|
|
|
|
+#if defined(LTC_HAVE_CLZL_BUILTIN)
|
|
|
|
+ if (x == 0)
|
|
|
|
+ return 0;
|
|
|
|
+ return sizeof(unsigned long) * CHAR_BIT - __builtin_clzl(x);
|
|
|
|
+#else
|
|
unsigned long c;
|
|
unsigned long c;
|
|
c = 0;
|
|
c = 0;
|
|
while (x) {
|
|
while (x) {
|
|
@@ -18,9 +23,9 @@ unsigned long der_object_identifier_bits(unsigned long x)
|
|
x >>= 1;
|
|
x >>= 1;
|
|
}
|
|
}
|
|
return c;
|
|
return c;
|
|
|
|
+#endif
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
Gets length of DER encoding of Object Identifier
|
|
Gets length of DER encoding of Object Identifier
|
|
@param nwords The number of OID words
|
|
@param nwords The number of OID words
|