/* parser auto-generated by pidl */

#include "replace.h"
#include "bin/default/librpc/gen_ndr/ndr_bcrypt_rsakey_blob.h"

_PUBLIC_ enum ndr_err_code ndr_push_BCRYPT_RSAPUBLIC_BLOB(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct BCRYPT_RSAPUBLIC_BLOB *r)
{
	NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 4));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x31415352));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bit_length));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->public_exponent_len));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->modulus_len));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
		NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->public_exponent, r->public_exponent_len));
		NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->modulus, r->modulus_len));
		NDR_CHECK(ndr_push_trailer_align(ndr, 4));
	}
	if (ndr_flags & NDR_BUFFERS) {
	}
	return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_BCRYPT_RSAPUBLIC_BLOB(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct BCRYPT_RSAPUBLIC_BLOB *r)
{
	uint32_t size_public_exponent_0 = 0;
	uint32_t size_modulus_0 = 0;
	NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_pull_align(ndr, 4));
		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->magic));
		if (r->magic < 826364754 || r->magic > 826364754) {
			return ndr_pull_error(ndr, NDR_ERR_RANGE, "value (%"PRIu32") out of range (%"PRIu32" - %"PRIu32")", (uint32_t)(r->magic), (uint32_t)(826364754), (uint32_t)(826364754));
		}
		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bit_length));
		if (r->bit_length < 1 || r->bit_length > 65536) {
			return ndr_pull_error(ndr, NDR_ERR_RANGE, "value (%"PRIu32") out of range (%"PRIu32" - %"PRIu32")", (uint32_t)(r->bit_length), (uint32_t)(1), (uint32_t)(65536));
		}
		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->public_exponent_len));
		if (r->public_exponent_len < 1 || r->public_exponent_len > 8) {
			return ndr_pull_error(ndr, NDR_ERR_RANGE, "value (%"PRIu32") out of range (%"PRIu32" - %"PRIu32")", (uint32_t)(r->public_exponent_len), (uint32_t)(1), (uint32_t)(8));
		}
		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->modulus_len));
		if (r->modulus_len < 1 || r->modulus_len > 8193) {
			return ndr_pull_error(ndr, NDR_ERR_RANGE, "value (%"PRIu32") out of range (%"PRIu32" - %"PRIu32")", (uint32_t)(r->modulus_len), (uint32_t)(1), (uint32_t)(8193));
		}
		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->prime1_len_unused));
		if (r->prime1_len_unused > 0) {
			return ndr_pull_error(ndr, NDR_ERR_RANGE, "value (%"PRIu32") out of range (%"PRIu32" - %"PRIu32")", (uint32_t)(r->prime1_len_unused), (uint32_t)(0), (uint32_t)(0));
		}
		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->prime2_len_unused));
		if (r->prime2_len_unused > 0) {
			return ndr_pull_error(ndr, NDR_ERR_RANGE, "value (%"PRIu32") out of range (%"PRIu32" - %"PRIu32")", (uint32_t)(r->prime2_len_unused), (uint32_t)(0), (uint32_t)(0));
		}
		size_public_exponent_0 = r->public_exponent_len;
		NDR_PULL_ALLOC_N(ndr, r->public_exponent, size_public_exponent_0);
		NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->public_exponent, size_public_exponent_0));
		size_modulus_0 = r->modulus_len;
		NDR_PULL_ALLOC_N(ndr, r->modulus, size_modulus_0);
		NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->modulus, size_modulus_0));
		NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
	}
	if (ndr_flags & NDR_BUFFERS) {
	}
	return NDR_ERR_SUCCESS;
}

static void ndr_print_flags_BCRYPT_RSAPUBLIC_BLOB(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct BCRYPT_RSAPUBLIC_BLOB *r)
{
	ndr_print_BCRYPT_RSAPUBLIC_BLOB(ndr, name, r);
}

_PUBLIC_ void ndr_print_BCRYPT_RSAPUBLIC_BLOB(struct ndr_print *ndr, const char *name, const struct BCRYPT_RSAPUBLIC_BLOB *r)
{
	ndr_print_struct(ndr, name, "BCRYPT_RSAPUBLIC_BLOB");
	if (r == NULL) { ndr_print_null(ndr); return; }
	ndr->depth++;
	ndr_print_uint32(ndr, "magic", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0x31415352:r->magic);
	ndr_print_uint32(ndr, "bit_length", r->bit_length);
	ndr_print_uint32(ndr, "public_exponent_len", r->public_exponent_len);
	ndr_print_uint32(ndr, "modulus_len", r->modulus_len);
	ndr_print_uint32(ndr, "prime1_len_unused", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->prime1_len_unused);
	ndr_print_uint32(ndr, "prime2_len_unused", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->prime2_len_unused);
	ndr_print_array_uint8(ndr, "public_exponent", r->public_exponent, r->public_exponent_len);
	ndr_print_array_uint8(ndr, "modulus", r->modulus, r->modulus_len);
	ndr->depth--;
}

#ifndef SKIP_NDR_TABLE_bcrypt_rsakey_blob
static const struct ndr_interface_public_struct bcrypt_rsakey_blob_public_structs[] = {
	{
		.name = "BCRYPT_RSAPUBLIC_BLOB",
		.struct_size = sizeof(struct BCRYPT_RSAPUBLIC_BLOB ),
		.ndr_push = (ndr_push_flags_fn_t) ndr_push_BCRYPT_RSAPUBLIC_BLOB,
		.ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_BCRYPT_RSAPUBLIC_BLOB,
		.ndr_print = (ndr_print_function_t) ndr_print_flags_BCRYPT_RSAPUBLIC_BLOB,
	},
	{ .name = NULL }
};

static const struct ndr_interface_call bcrypt_rsakey_blob_calls[] = {
	{ .name = NULL }
};

static const char * const bcrypt_rsakey_blob_endpoint_strings[] = {
	"ncacn_np:[\\pipe\\bcrypt_rsakey_blob]", 
};

static const struct ndr_interface_string_array bcrypt_rsakey_blob_endpoints = {
	.count	= 1,
	.names	= bcrypt_rsakey_blob_endpoint_strings
};

static const char * const bcrypt_rsakey_blob_authservice_strings[] = {
	"host", 
};

static const struct ndr_interface_string_array bcrypt_rsakey_blob_authservices = {
	.count	= 1,
	.names	= bcrypt_rsakey_blob_authservice_strings
};


const struct ndr_interface_table ndr_table_bcrypt_rsakey_blob = {
	.name		= "bcrypt_rsakey_blob",
	.num_calls	= 0,
	.calls		= bcrypt_rsakey_blob_calls,
	.num_public_structs	= 1,
	.public_structs		= bcrypt_rsakey_blob_public_structs,
	.endpoints	= &bcrypt_rsakey_blob_endpoints,
	.authservices	= &bcrypt_rsakey_blob_authservices
};

#endif /* SKIP_NDR_TABLE_bcrypt_rsakey_blob */
