block.h (3590b27c7a2be7a24b4b265e2e9458b3761103e1) block.h (6d49d3a859b0f19226dbb0df5e7f50267b42f45c)
1/*
2 * QEMU Crypto block device encryption
3 *
4 * Copyright (c) 2015-2016 Red Hat, Inc.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 132 unchanged lines hidden (view full) ---

141 const char *optprefix,
142 QCryptoBlockInitFunc initfunc,
143 QCryptoBlockWriteFunc writefunc,
144 void *opaque,
145 Error **errp);
146
147
148/**
1/*
2 * QEMU Crypto block device encryption
3 *
4 * Copyright (c) 2015-2016 Red Hat, Inc.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 132 unchanged lines hidden (view full) ---

141 const char *optprefix,
142 QCryptoBlockInitFunc initfunc,
143 QCryptoBlockWriteFunc writefunc,
144 void *opaque,
145 Error **errp);
146
147
148/**
149 * qcrypto_block_calculate_payload_offset:
150 * @create_opts: the encryption options
151 * @optprefix: name prefix for options
152 * @len: output for number of header bytes before payload
153 * @errp: pointer to a NULL-initialized error object
154 *
155 * Calculate the number of header bytes before the payload in an encrypted
156 * storage volume. The header is an area before the payload that is reserved
157 * for encryption metadata.
158 *
159 * Returns: true on success, false on error
160 */
161bool
162qcrypto_block_calculate_payload_offset(QCryptoBlockCreateOptions *create_opts,
163 const char *optprefix,
164 size_t *len,
165 Error **errp);
166
167
168/**
149 * qcrypto_block_get_info:
150 * @block: the block encryption object
151 * @errp: pointer to a NULL-initialized error object
152 *
153 * Get information about the configuration options for the
154 * block encryption object. This includes details such as
155 * the cipher algorithms, modes, and initialization vector
156 * generators.

--- 107 unchanged lines hidden (view full) ---

264 * @block: the block encryption object
265 *
266 * Release all resources associated with the encryption
267 * object
268 */
269void qcrypto_block_free(QCryptoBlock *block);
270
271G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoBlock, qcrypto_block_free)
169 * qcrypto_block_get_info:
170 * @block: the block encryption object
171 * @errp: pointer to a NULL-initialized error object
172 *
173 * Get information about the configuration options for the
174 * block encryption object. This includes details such as
175 * the cipher algorithms, modes, and initialization vector
176 * generators.

--- 107 unchanged lines hidden (view full) ---

284 * @block: the block encryption object
285 *
286 * Release all resources associated with the encryption
287 * object
288 */
289void qcrypto_block_free(QCryptoBlock *block);
290
291G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoBlock, qcrypto_block_free)
292G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoBlockCreateOptions,
293 qapi_free_QCryptoBlockCreateOptions)
272
273#endif /* QCRYPTO_BLOCK_H */
294
295#endif /* QCRYPTO_BLOCK_H */