23c57df72989c916b3e98084eb88d48777999691mcpowers * CDDL HEADER START
23c57df72989c916b3e98084eb88d48777999691mcpowers * The contents of this file are subject to the terms of the
23c57df72989c916b3e98084eb88d48777999691mcpowers * Common Development and Distribution License (the "License").
23c57df72989c916b3e98084eb88d48777999691mcpowers * You may not use this file except in compliance with the License.
23c57df72989c916b3e98084eb88d48777999691mcpowers * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
23c57df72989c916b3e98084eb88d48777999691mcpowers * See the License for the specific language governing permissions
23c57df72989c916b3e98084eb88d48777999691mcpowers * and limitations under the License.
23c57df72989c916b3e98084eb88d48777999691mcpowers * When distributing Covered Code, include this CDDL HEADER in each
23c57df72989c916b3e98084eb88d48777999691mcpowers * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
23c57df72989c916b3e98084eb88d48777999691mcpowers * If applicable, add the following below this CDDL HEADER, with the
23c57df72989c916b3e98084eb88d48777999691mcpowers * fields enclosed by brackets "[]" replaced with your own identifying
23c57df72989c916b3e98084eb88d48777999691mcpowers * information: Portions Copyright [yyyy] [name of copyright owner]
23c57df72989c916b3e98084eb88d48777999691mcpowers * CDDL HEADER END
983a10335731bc55a0b7a37f195575fa109e30d4Mark Powers * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23c57df72989c916b3e98084eb88d48777999691mcpowers * Use is subject to license terms.
23c57df72989c916b3e98084eb88d48777999691mcpowers * Initialize by setting iov_or_mp to point to the current iovec or mp,
23c57df72989c916b3e98084eb88d48777999691mcpowers * and by setting current_offset to an offset within the current iovec or mp.
23c57df72989c916b3e98084eb88d48777999691mcpowerscrypto_init_ptrs(crypto_data_t *out, void **iov_or_mp, offset_t *current_offset)
23c57df72989c916b3e98084eb88d48777999691mcpowers for (mp = out->cd_mp; mp != NULL && offset >= MBLKL(mp);
23c57df72989c916b3e98084eb88d48777999691mcpowers } /* end switch */
23c57df72989c916b3e98084eb88d48777999691mcpowers * Get pointers for where in the output to copy a block of encrypted or
23c57df72989c916b3e98084eb88d48777999691mcpowers * decrypted data. The iov_or_mp argument stores a pointer to the current
23c57df72989c916b3e98084eb88d48777999691mcpowers * iovec or mp, and offset stores an offset into the current iovec or mp.
23c57df72989c916b3e98084eb88d48777999691mcpowerscrypto_get_ptrs(crypto_data_t *out, void **iov_or_mp, offset_t *current_offset,
23c57df72989c916b3e98084eb88d48777999691mcpowers uint8_t **out_data_1, size_t *out_data_1_len, uint8_t **out_data_2,
23c57df72989c916b3e98084eb88d48777999691mcpowers /* one block fits */
23c57df72989c916b3e98084eb88d48777999691mcpowers /* can fit one block into this iov */
23c57df72989c916b3e98084eb88d48777999691mcpowers /* one block spans two iovecs */
23c57df72989c916b3e98084eb88d48777999691mcpowers /* can fit one block into this mblk */
23c57df72989c916b3e98084eb88d48777999691mcpowers /* one block spans two mblks */
104d3bde5b4ac46904f144d3676110fc57a69603Dan OpenSolaris Anderson *out_data_1_len = _PTRDIFF(mp->b_wptr, p);
23c57df72989c916b3e98084eb88d48777999691mcpowers } /* end switch */