*/
// clang-format off
+
+#include <cstddef>
+
#ifdef WIN32
#include <windows.h>
#include <wincrypt.h>
#else
- #include <time.h>
+ #include <ctime>
+
#endif
// clang-format on
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstring>
+#include <cstdio>
+#include <cstdint>
#include <config.h>
-#if USE_SYSTEM_GMP || defined (__ANDROID__) || defined (ANDROID)
+#if USE_SYSTEM_GMP
#include <gmp.h>
#else
#include <mini-gmp.h>
case SRP_SHA384: return SHA384_DIGEST_LENGTH;
case SRP_SHA512: return SHA512_DIGEST_LENGTH;
*/
- default: return -1;
+ default: return 0;
};
}
// clang-format on
if (fill_buff() != SRP_OK) goto error_and_exit;
*bytes_s = (unsigned char *)srp_alloc(size_to_fill);
if (!*bytes_s) goto error_and_exit;
- memcpy(*bytes_s, &g_rand_buff + g_rand_idx, size_to_fill);
+ memcpy(*bytes_s, &g_rand_buff[g_rand_idx], size_to_fill);
g_rand_idx += size_to_fill;
}
goto cleanup_and_exit;
}
- memcpy((char *)ver->username, username, ulen);
+ memcpy(ver->username, username, ulen);
ver->authenticated = 0;
goto cleanup_and_exit;
*bytes_M = usr->M;
- if (len_M) *len_M = hash_length(usr->hash_alg);
+ *len_M = hash_length(usr->hash_alg);
} else {
*bytes_M = NULL;
- if (len_M) *len_M = 0;
+ *len_M = 0;
}
cleanup_and_exit: