Are you allowed to shuffle your library at any time?
You can't shuffle whenever you want; rule 401.2 explicitly handles this case.


  401.2. Each library must be kept in a single face-down pile. Players can’t look at or change the order of cards in a library.


Plus, if you could shuffle at will, it would make cards that let you shuffle like Ponder pretty redundant.