def pkcs_1_5(b: bytes, size: int) -> int:
    """
    PKCS#1.5 padding.
    Create a block of the form:
        00 || BT || PS || 00 || b
    Where BT is usually 0x01 and
    PS are 0xff bytes in a number
    such that the whole block is filled.

    The length of b must be less than the size of
    the block minus 3 (00 x 2 and BT).

    :param b: A buffer of bytes.
    :param size: The block size.
    :return: The padded buffer (as int).
    """
    assert len(b) < size - 3

    padded = bytearray((0x00, 0x02))
    padded += bytearray(0xff for _ in range(size - 3 - len(b)))
    padded += bytearray((0x00,))
    padded += b

    return int.from_bytes(padded, byteorder="big")