easier calculation
This commit is contained in:
parent
38143771d7
commit
b84bea8e78
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user