Skip to content

Commit d1d9566

Browse files
committed
format code
1 parent 30b3a9a commit d1d9566

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/pk/asn1/der/bit/der_decode_raw_bit_string.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen,
8585

8686
/* decode/store the bits */
8787
for (y = 0; y < blen; y++) {
88-
if (in[x] & (1 << (7 - (y & 7)))) {
89-
SETBIT(out[y/8], 7-(y%8));
90-
} else {
91-
CLRBIT(out[y/8], 7-(y%8));
92-
}
93-
if ((y & 7) == 7) {
94-
++x;
95-
}
88+
if (in[x] & (1 << (7 - (y & 7)))) {
89+
SETBIT(out[y/8], 7-(y%8));
90+
} else {
91+
CLRBIT(out[y/8], 7-(y%8));
92+
}
93+
if ((y & 7) == 7) {
94+
++x;
95+
}
9696
}
9797

9898
/* we done */

src/pk/asn1/der/bit/der_encode_raw_bit_string.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
Store a BIT STRING
2323
@param in The array of bits to store (8 per char)
24-
@param inlen The number of bits tostore
24+
@param inlen The number of bits to store
2525
@param out [out] The destination for the DER encoded BIT STRING
2626
@param outlen [in/out] The max size and resulting size of the DER BIT STRING
2727
@return CRYPT_OK if successful
@@ -68,11 +68,11 @@ int der_encode_raw_bit_string(const unsigned char *in, unsigned long inlen,
6868

6969
/* store the bits in big endian format */
7070
for (y = buf = 0; y < inlen; y++) {
71-
buf |= (getbit(in[y/8],7-y%8)?1:0) << (7 - (y & 7));
72-
if ((y & 7) == 7) {
73-
out[x++] = buf;
74-
buf = 0;
75-
}
71+
buf |= (getbit(in[y/8],7-y%8)?1:0) << (7 - (y & 7));
72+
if ((y & 7) == 7) {
73+
out[x++] = buf;
74+
buf = 0;
75+
}
7676
}
7777
/* store last byte */
7878
if (inlen & 7) {

src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen
5858

5959
return der_encode_sequence_multi(out, outlen,
6060
LTC_ASN1_SEQUENCE, (unsigned long)sizeof(alg_id)/sizeof(alg_id[0]), alg_id,
61-
LTC_ASN1_RAW_BIT_STRING, (unsigned long)(public_key_len*8), public_key,
61+
LTC_ASN1_RAW_BIT_STRING, public_key_len*8U, public_key,
6262
LTC_ASN1_EOL, 0UL, NULL);
6363

6464
}

0 commit comments

Comments
 (0)