Common password derivation function for different encryption methods
First, consider dropping bcrypt, because of its output limitations. If you are concerned about GPUs and ASICs, there's always scrypt. If you decide to go with bcrypt, you won't have 256-bit security with AES-256 and will need to pad the key somehow or disallow that combination.


I would simply call the KDF with a constant 256-bit output, which matches the blocksize of SHA-256-HMAC if you use that as PBKDF2 PRF (so it's ~ as fast as shorter outputs).
Then you can truncate the input of AES-128 to 128 bits and 3DES to 168 bits, which is what PBKDF2 would do anyway.