Go to the documentation of this file.
28 if (
dst !=
nullptr && src !=
nullptr) {
37 char** error_details) {
39 if (counter_size == 0) {
40 const char error_msg[] =
"counter_size is invalid.";
44 if (overflow_size == 0 || overflow_size >= counter_size) {
45 const char error_msg[] =
"overflow_size is invalid.";
49 if (crypter_counter ==
nullptr) {
50 const char error_msg[] =
"crypter_counter is nullptr.";
56 (*crypter_counter)->
size = counter_size;
57 (*crypter_counter)->overflow_size = overflow_size;
58 (*crypter_counter)->counter =
59 static_cast<unsigned char*
>(
gpr_zalloc(counter_size));
61 ((*crypter_counter)->counter)[counter_size - 1] = 0x80;
68 char** error_details) {
70 if (crypter_counter ==
nullptr) {
71 const char error_msg[] =
"crypter_counter is nullptr.";
75 if (is_overflow ==
nullptr) {
76 const char error_msg[] =
"is_overflow is nullptr.";
84 if ((crypter_counter->
counter)[
i] != 0x00) {
100 if (crypter_counter ==
nullptr) {
103 return crypter_counter->
size;
107 if (crypter_counter ==
nullptr) {
110 return crypter_counter->
counter;
114 if (crypter_counter !=
nullptr) {
unsigned char * alts_counter_get_counter(alts_counter *crypter_counter)
GPRAPI void gpr_free(void *ptr)
GPRAPI void * gpr_malloc(size_t size)
grpc_status_code alts_counter_increment(alts_counter *crypter_counter, bool *is_overflow, char **error_details)
@ GRPC_STATUS_INVALID_ARGUMENT
size_t alts_counter_get_size(alts_counter *crypter_counter)
GPRAPI void * gpr_zalloc(size_t size)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static void maybe_copy_error_msg(const char *src, char **dst)
@ GRPC_STATUS_FAILED_PRECONDITION
grpc_status_code alts_counter_create(bool is_client, size_t counter_size, size_t overflow_size, alts_counter **crypter_counter, char **error_details)
void alts_counter_destroy(alts_counter *crypter_counter)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:40