Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MONGOCRYPT-702 FLE2 range floating point correctness issue when using precision mode #868

Merged
merged 11 commits into from
Jul 24, 2024
12 changes: 10 additions & 2 deletions src/mc-range-encoding-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ typedef struct {
} mc_getTypeInfoDouble_args_t;

// `mc_canUsePrecisionModeDouble` returns true if the domain can be represented in fewer than 64 bits.
bool mc_canUsePrecisionModeDouble(double min, double max, uint32_t precision, uint32_t *maxBitsOut);
bool mc_canUsePrecisionModeDouble(double min,
double max,
uint32_t precision,
uint32_t *maxBitsOut,
mongocrypt_status_t *status);

/* mc_getTypeInfoDouble encodes the double `args.value` into an OSTType_Double
* `out`. Returns false and sets `status` on error. */
Expand All @@ -111,7 +115,11 @@ typedef struct {
} mc_getTypeInfoDecimal128_args_t;

// `mc_canUsePrecisionModeDecimal` returns true if the domain can be represented in fewer than 128 bits.
bool mc_canUsePrecisionModeDecimal(mc_dec128 min, mc_dec128 max, uint32_t precision, uint32_t *maxBitsOut);
bool mc_canUsePrecisionModeDecimal(mc_dec128 min,
mc_dec128 max,
uint32_t precision,
uint32_t *maxBitsOut,
mongocrypt_status_t *status);

/**
* @brief Obtain the OST encoding of a finite Decimal128 value.
Expand Down
Loading
Loading