Just for anyone reading this: DO NOT ROLL YOUR OWN ALGORITHM.
Besides that, is implementing a well-trusted protocol with well-trusted algorithms and libraries a good idea? Is this likely to colossally fail like rolling your own crypto? Could this be used in production after enough peer review? (I know that rolling your own crypto is definitely NOT secure)