17#ifndef MONGOCRYPT_INDEXED_ENCRYPTED_VALUE_PRIVATE_V2_H
18#define MONGOCRYPT_INDEXED_ENCRYPTED_VALUE_PRIVATE_V2_H
20#include "mc-fle2-tag-and-encrypted-metadata-block-private.h"
21#include "mc-tokens-private.h"
22#include "mongocrypt-buffer-private.h"
23#include "mongocrypt-crypto-private.h"
24#include "mongocrypt-status-private.h"
107 kFLE2IEVTypeEqualityV2,
110} _mc_fle2_iev_v2_type;
114 uint8_t fle_blob_subtype;
115 uint8_t bson_value_type;
117 uint32_t substr_tag_count;
118 uint32_t suffix_tag_count;
119 _mongocrypt_buffer_t S_KeyId;
120 _mongocrypt_buffer_t ServerEncryptedValue;
123 _mc_fle2_iev_v2_type type;
124 bool ClientEncryptedValueDecoded;
125 bool ClientValueDecoded;
129 _mongocrypt_buffer_t DecryptedServerEncryptedValue;
132 _mongocrypt_buffer_t K_KeyId;
133 _mongocrypt_buffer_t ClientEncryptedValue;
137 _mongocrypt_buffer_t ClientValue;
139 mc_FLE2TagAndEncryptedMetadataBlock_t *metadata;
140} mc_FLE2IndexedEncryptedValueV2_t;
142mc_FLE2IndexedEncryptedValueV2_t *mc_FLE2IndexedEncryptedValueV2_new(
void);
143bson_type_t mc_FLE2IndexedEncryptedValueV2_get_bson_value_type(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
164bool mc_FLE2IndexedEncryptedValueV2_parse(mc_FLE2IndexedEncryptedValueV2_t *iev,
165 const _mongocrypt_buffer_t *buf,
178bool mc_FLE2IndexedEncryptedValueV2_serialize(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
179 _mongocrypt_buffer_t *buf,
186bool mc_FLE2IndexedEncryptedValueV2_validate(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
mongocrypt_status_t *status);
188const _mongocrypt_buffer_t *mc_FLE2IndexedEncryptedValueV2_get_S_KeyId(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
191bool mc_FLE2IndexedEncryptedValueV2_add_S_Key(_mongocrypt_crypto_t *crypto,
192 mc_FLE2IndexedEncryptedValueV2_t *iev,
193 const _mongocrypt_buffer_t *S_Key,
196const _mongocrypt_buffer_t *
197mc_FLE2IndexedEncryptedValueV2_get_ClientEncryptedValue(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
200const _mongocrypt_buffer_t *mc_FLE2IndexedEncryptedValueV2_get_K_KeyId(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
203bool mc_FLE2IndexedEncryptedValueV2_add_K_Key(_mongocrypt_crypto_t *crypto,
204 mc_FLE2IndexedEncryptedValueV2_t *iev,
205 const _mongocrypt_buffer_t *K_Key,
208const _mongocrypt_buffer_t *mc_FLE2IndexedEncryptedValueV2_get_ClientValue(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
211uint32_t mc_FLE2IndexedEncryptedValueV2_get_edge_count(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
214bool mc_FLE2IndexedEncryptedValueV2_get_substr_tag_count(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
218bool mc_FLE2IndexedEncryptedValueV2_get_suffix_tag_count(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
222bool mc_FLE2IndexedEncryptedValueV2_get_prefix_tag_count(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
226bool mc_FLE2IndexedEncryptedValueV2_get_edge(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
227 mc_FLE2TagAndEncryptedMetadataBlock_t *out,
228 const uint32_t edge_index,
231bool mc_FLE2IndexedEncryptedValueV2_get_metadata(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
232 mc_FLE2TagAndEncryptedMetadataBlock_t *out,
235bool mc_FLE2IndexedEncryptedValueV2_get_exact_metadata(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
236 mc_FLE2TagAndEncryptedMetadataBlock_t *out,
239bool mc_FLE2IndexedEncryptedValueV2_get_substr_metadata(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
240 mc_FLE2TagAndEncryptedMetadataBlock_t *out,
241 const uint32_t block_index,
244bool mc_FLE2IndexedEncryptedValueV2_get_suffix_metadata(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
245 mc_FLE2TagAndEncryptedMetadataBlock_t *out,
246 const uint32_t block_index,
249bool mc_FLE2IndexedEncryptedValueV2_get_prefix_metadata(
const mc_FLE2IndexedEncryptedValueV2_t *iev,
250 mc_FLE2TagAndEncryptedMetadataBlock_t *out,
251 const uint32_t block_index,
254void mc_FLE2IndexedEncryptedValueV2_destroy(mc_FLE2IndexedEncryptedValueV2_t *iev);
struct _mongocrypt_status_t mongocrypt_status_t
Definition mongocrypt.h:152
Definition mc-fle2-payload-iev-private-v2.h:112