Go to the documentation of this file.
74 for (
size_t i = 0;
i < sb->
count;
i++) {
93 for (
size_t i = 0;
i <
first->length;
i++) {
96 GPR_ASSERT(first_ptr !=
nullptr && second_ptr !=
nullptr);
97 if ((*first_ptr) != (*second_ptr)) {
107 bool enable_extra_copy) {
114 size_t max_protected_frame_size = 1024;
115 size_t actual_max_protected_frame_size;
118 key, key_length, rekey,
true, integrity_only,
119 enable_extra_copy, &max_protected_frame_size,
122 fixture->client, &actual_max_protected_frame_size) ==
TSI_OK);
123 GPR_ASSERT(actual_max_protected_frame_size == max_protected_frame_size);
125 key, key_length, rekey,
false, integrity_only,
126 enable_extra_copy, &max_protected_frame_size,
129 fixture->server, &actual_max_protected_frame_size) ==
TSI_OK);
130 GPR_ASSERT(actual_max_protected_frame_size == max_protected_frame_size);
163 if (var ==
nullptr) {
180 int min_progress_size;
199 &min_progress_size) ==
TSI_OK);
209 &min_progress_size) ==
TSI_OK);
255 bool enable_extra_copy) {
258 false,
true, enable_extra_copy);
264 false,
false, enable_extra_copy);
270 true,
true, enable_extra_copy);
276 true,
false, enable_extra_copy);
283 bool enable_extra_copy) {
286 false,
true, enable_extra_copy);
292 false,
false, enable_extra_copy);
298 true,
true, enable_extra_copy);
304 true,
false, enable_extra_copy);
310 int main(
int argc,
char** argv) {
tsi_result tsi_zero_copy_grpc_protector_unprotect(tsi_zero_copy_grpc_protector *self, grpc_slice_buffer *protected_slices, grpc_slice_buffer *unprotected_slices, int *min_progress_size)
uint32_t gsec_test_bias_random_uint32(uint32_t max_length)
void tsi_zero_copy_grpc_protector_destroy(tsi_zero_copy_grpc_protector *self)
constexpr size_t kSealRepeatTimes
static void alts_zero_copy_protector_seal_unseal_large_buffer_tests(bool enable_extra_copy)
grpc_slice_buffer original_sb
tsi_result tsi_zero_copy_grpc_protector_protect(tsi_zero_copy_grpc_protector *self, grpc_slice_buffer *unprotected_slices, grpc_slice_buffer *protected_slices)
static uint8_t * pointer_to_nth_byte(grpc_slice_buffer *sb, size_t index)
GPRAPI void gpr_free(void *ptr)
#define GRPC_SLICE_MALLOC(len)
tsi_zero_copy_grpc_protector * client
void gsec_test_random_array(uint8_t **bytes, size_t length)
static void alts_zero_copy_grpc_protector_test_var_destroy(alts_zero_copy_grpc_protector_test_var *var)
GPRAPI void * gpr_zalloc(size_t size)
constexpr size_t kSmallBufferSize
int main(int argc, char **argv)
constexpr size_t kChannelMinSize
grpc_slice_buffer protected_sb
static const char fixture[]
const size_t kAes128GcmRekeyKeyLength
static bool are_slice_buffers_equal(grpc_slice_buffer *first, grpc_slice_buffer *second)
grpc_slice_buffer unprotected_sb
#define GRPC_SLICE_START_PTR(slice)
tsi_zero_copy_grpc_protector * server
static void seal_unseal_small_buffer(tsi_zero_copy_grpc_protector *sender, tsi_zero_copy_grpc_protector *receiver)
tsi_result alts_zero_copy_grpc_protector_create(const uint8_t *key, size_t key_size, bool is_rekey, bool is_client, bool is_integrity_only, bool enable_extra_copy, size_t *max_protected_frame_size, tsi_zero_copy_grpc_protector **protector)
static void create_random_slice_buffer(grpc_slice_buffer *sb, grpc_slice_buffer *dup_sb, size_t length)
constexpr size_t kLargeBufferSize
static alts_zero_copy_grpc_protector_test_var * alts_zero_copy_grpc_protector_test_var_create()
GPRAPI void grpc_slice_buffer_init(grpc_slice_buffer *sb)
#define GRPC_SLICE_LENGTH(slice)
GPRAPI void grpc_slice_buffer_add(grpc_slice_buffer *sb, grpc_slice slice)
static void seal_unseal_large_buffer(tsi_zero_copy_grpc_protector *sender, tsi_zero_copy_grpc_protector *receiver)
grpc_core::ExecCtx exec_ctx
grpc_slice_buffer duplicate_sb
GPRAPI void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n, grpc_slice_buffer *dst)
grpc_slice_buffer staging_sb
static alts_zero_copy_grpc_protector_test_fixture * alts_zero_copy_grpc_protector_test_fixture_create(bool rekey, bool integrity_only, bool enable_extra_copy)
void grpc_slice_buffer_destroy_internal(grpc_slice_buffer *sb)
tsi_result tsi_zero_copy_grpc_protector_max_frame_size(tsi_zero_copy_grpc_protector *self, size_t *max_frame_size)
void gsec_test_random_bytes(uint8_t *bytes, size_t length)
GRPCAPI void grpc_init(void)
static void alts_zero_copy_protector_seal_unseal_small_buffer_tests(bool enable_extra_copy)
constexpr size_t kZeroCopyFrameLengthFieldSize
const size_t kAes128GcmKeyLength
constexpr size_t kChannelMaxSize
static void alts_zero_copy_grpc_protector_test_fixture_destroy(alts_zero_copy_grpc_protector_test_fixture *fixture)
GRPCAPI void grpc_shutdown(void)
void grpc_slice_buffer_reset_and_unref_internal(grpc_slice_buffer *sb)
GPRAPI grpc_slice grpc_slice_ref(grpc_slice s)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:41