Writing your own crypto is a bad idea, but in research sometimes the goals of your research require you to become good enough, and by good enough, I mean a notable expert in the "writing your own crypto" equivalent. Which in this case would be something like writing your own linear algebra library functions for research you plan to publish.