Match bouncy castle's output