Optimizations for keystore format. Sub-percent speedup :-P