static void ocb_block_lshift(const unsigned char *in, size_t shift,
                             unsigned char *out)
{
    unsigned char shift_mask;
    int i;
    unsigned char mask[15];
    shift_mask = 0xff;
    shift_mask <<= (8 - shift);
    for (i = 15; i >= 0; i--) {
        if (i > 0) {
            mask[i - 1] = in[i] & shift_mask;
            mask[i - 1] >>= 8 - shift;
        }
        out[i] = in[i] << shift;
        if (i != 15) {
            out[i] ^= mask[i];
        }
    }
}
['static void ocb_block_lshift(const unsigned char *in, size_t shift,\n                             unsigned char *out)\n{\n    unsigned char shift_mask;\n    int i;\n    unsigned char mask[15];\n    shift_mask = 0xff;\n    shift_mask <<= (8 - shift);\n    for (i = 15; i >= 0; i--) {\n        if (i > 0) {\n            mask[i - 1] = in[i] & shift_mask;\n            mask[i - 1] >>= 8 - shift;\n        }\n        out[i] = in[i] << shift;\n        if (i != 15) {\n            out[i] ^= mask[i];\n        }\n    }\n}']