Imported from https://github.com/researchmm/tasn