ripemd: move ripemd{256, 320} into separate functions