added encoding for BSM. not tested against reference impl yet