move chacha code to private header