Cosmic ray acceleration in hydromagnetic flux tubes