add dot and norm functions

Added functions needed for LLL.