Skip to content

Commit 055811f

Browse files
authored
MONGOCRYPT-890 document FLE2InsertUpdatePayloadV2 b field (#1147)
1 parent f216afa commit 055811f

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

src/mc-fle2-insert-update-payload-private-v2.h

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,19 @@
2525
#include "mongocrypt-private.h"
2626
#include "mongocrypt.h"
2727

28+
/*
29+
* The *TokenSet types corresponds to the following BSON document:
30+
* d: <binary> // EDC derived from data & contention factor token
31+
* s: <binary> // ESC derived from data & contention factor token
32+
* l: <binary> // server derived from data token
33+
* p: <binary> // encrypted token for compaction
34+
*/
2835
#define DEF_TEXT_SEARCH_TOKEN_SET(Type) \
2936
typedef struct { \
30-
_mongocrypt_buffer_t edcDerivedToken; \
31-
_mongocrypt_buffer_t escDerivedToken; \
32-
_mongocrypt_buffer_t serverDerivedFromDataToken; \
33-
_mongocrypt_buffer_t encryptedTokens; \
37+
_mongocrypt_buffer_t edcDerivedToken; /* d */ \
38+
_mongocrypt_buffer_t escDerivedToken; /* s */ \
39+
_mongocrypt_buffer_t serverDerivedFromDataToken; /* l */ \
40+
_mongocrypt_buffer_t encryptedTokens; /* p */ \
3441
} mc_Text##Type##TokenSet_t; \
3542
void mc_Text##Type##TokenSet_init(mc_Text##Type##TokenSet_t *); \
3643
void mc_Text##Type##TokenSet_cleanup(mc_Text##Type##TokenSet_t *); \
@@ -41,6 +48,14 @@ DEF_TEXT_SEARCH_TOKEN_SET(Substring);
4148
DEF_TEXT_SEARCH_TOKEN_SET(Suffix);
4249
DEF_TEXT_SEARCH_TOKEN_SET(Prefix);
4350

51+
/**
52+
* TextSearchTokenSets corresponds to following BSON document:
53+
*
54+
* e: <TextExactTokenSet> // Holds tokens for exact string search
55+
* s: array<TextSubstringTokenSet> // Holds tokens for substring search
56+
* u: array<TextSuffixTokenSet> // Holds tokens for suffix search
57+
* p: array<TextPrefixTokenSet> // Holds tokens for prefix search
58+
*/
4459
typedef struct {
4560
mc_TextExactTokenSet_t exact; // e
4661
mc_array_t substringArray; // s
@@ -78,6 +93,7 @@ void mc_TextSearchTokenSets_cleanup(mc_TextSearchTokenSets_t *);
7893
* tf: optional<int32> // Trim Factor. Only included for range payloads.
7994
* mn: optional<any> // Index Min. Only included for range payloads.
8095
* mx: optional<any> // Index Max. Only included for range payloads.
96+
* b: optional<TextSearchTokenSets> // Only included for text payloads.
8197
*
8298
* p is the result of:
8399
* Encrypt(

0 commit comments

Comments
 (0)