Perhaps it would make sense to separate the IKM -> PRK and the PRK -> derived key steps from each other? It may also help reduce the arity of the function :-) While I agree that this is dangerous (if people make uncouth assumptions about their IKM and assume it's totally okay to use as a PRK), we're in hazmat, right?