Did you test your code?
ext_data is a uint64_t *.
The code you wrote probably won't work.