easier calculation

This commit is contained in:
Steffen Jaeckel 2017-11-23 18:30:19 +01:00
parent 38143771d7
commit b84bea8e78
2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ int der_encode_bit_string(const unsigned char *in, unsigned long inlen,
/* store header (include bit padding count in length) */
x = 0;
y = (inlen >> 3) + ((inlen&7) ? 1 : 0) + 1;
y = ((inlen + 7) >> 3) + 1;
out[x++] = 0x03;
if (y < 128) {

View File

@ -49,7 +49,7 @@ int der_encode_raw_bit_string(const unsigned char *in, unsigned long inlen,
/* store header (include bit padding count in length) */
x = 0;
y = (inlen >> 3) + ((inlen&7) ? 1 : 0) + 1;
y = ((inlen + 7) >> 3) + 1;
out[x++] = 0x03;
if (y < 128) {