static inline unsigned int constant_time_ge(unsigned int a, unsigned int b)
	{
	unsigned int ge;
	ge = ~((a ^ b) | (a - b));
	ge |= a & ~b;
	return constant_time_msb(ge);
	}
['int tls1_cbc_remove_padding(const SSL* s,\n\t\t\t    SSL3_RECORD *rec,\n\t\t\t    unsigned block_size,\n\t\t\t    unsigned mac_size)\n\t{\n\tunsigned padding_length, good, to_check, i;\n\tconst unsigned overhead = 1   + mac_size;\n\tif (SSL_USE_EXPLICIT_IV(s))\n\t\t{\n\t\tif (overhead + block_size > rec->length)\n\t\t\treturn 0;\n\t\trec->data += block_size;\n\t\trec->input += block_size;\n\t\trec->length -= block_size;\n\t\trec->orig_len -= block_size;\n\t\t}\n\telse if (overhead > rec->length)\n\t\treturn 0;\n\tpadding_length = rec->data[rec->length-1];\n\tif ( (s->options&SSL_OP_TLS_BLOCK_PADDING_BUG) && !s->expand)\n\t\t{\n\t\tif ((memcmp(s->s3->read_sequence, "\\0\\0\\0\\0\\0\\0\\0\\0",8) == 0) &&\n\t\t    !(padding_length & 1))\n\t\t\t{\n\t\t\ts->s3->flags|=TLS1_FLAGS_TLS_PADDING_BUG;\n\t\t\t}\n\t\tif ((s->s3->flags & TLS1_FLAGS_TLS_PADDING_BUG) &&\n\t\t    padding_length > 0)\n\t\t\t{\n\t\t\tpadding_length--;\n\t\t\t}\n\t\t}\n\tif (EVP_CIPHER_flags(s->enc_read_ctx->cipher)&EVP_CIPH_FLAG_AEAD_CIPHER)\n\t\t{\n\t\trec->length -= padding_length + 1;\n\t\treturn 1;\n\t\t}\n\tgood = constant_time_ge(rec->length, overhead+padding_length);\n\tto_check = 255;\n\tif (to_check > rec->length-1)\n\t\tto_check = rec->length-1;\n\tfor (i = 0; i < to_check; i++)\n\t\t{\n\t\tunsigned char mask = constant_time_ge_8(padding_length, i);\n\t\tunsigned char b = rec->data[rec->length-1-i];\n\t\tgood &= ~(mask&(padding_length ^ b));\n\t\t}\n\tgood = constant_time_eq(0xff, good & 0xff);\n\trec->length -= good & (padding_length+1);\n\treturn (int)((good & 1) | (~good & -1));\n\t}', 'static inline unsigned char constant_time_ge_8(unsigned int a, unsigned int b)\n\t{\n\treturn (unsigned char)(constant_time_ge(a, b));\n\t}', 'static inline unsigned int constant_time_ge(unsigned int a, unsigned int b)\n\t{\n\tunsigned int ge;\n\tge = ~((a ^ b) | (a - b));\n\tge |= a & ~b;\n\treturn constant_time_msb(ge);\n\t}']