checkNotNull(user.getUsername(), "Username should not be null");
checkNotNull(user.getHash(), "Password should not be null");
checkNotNull(user.getSalt(), "Salt should not be null");
if (users().containsKey(user.getUsername())) {
throw new DuplicateUserException();
}
// hash from client is already stretched. stretch some more. distance from what is stored vs password is
// 2^(LoginView.EXP + UserDAOImpl.EXP), i.e. 2^29
logger.info("Stretching");