For no reason other than it seemed fun, I used this new knowledge to implement my own version of said key-gen, in my choice of dev environment: Swift and Xcode playgrounds. Fun little exercise.
https://gist.github.com/Bonney/5cc85f41cdeb80146c7d5169ded8a...