Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ccfelius committed Nov 7, 2024
1 parent a4e0caa commit 17acdf7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
16 changes: 1 addition & 15 deletions src/core/functions/scalar/encrypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,24 +219,10 @@ void ExecuteEncryptStructExecutor(Vector &vector, Vector &result, idx_t size, Ex
D_ASSERT(CheckEncryption(printable_encrypted_data, buffer_p, size, reinterpret_cast<const_data_ptr_t>(name.GetData()), state) == 1);
#endif

LogicalType struct_type = LogicalType::STRUCT({
{"nonce", LogicalType::INTEGER},
{"value", LogicalType::INTEGER}
});

struct_type[0] = 1;
struct_type[1] =

// Use StructWriter to return struct result
StructWriter writer(result, struct_type);
writer.Write<idx_t, int32_t>(0, nonce);
writer.Write<idx_t, T>(1, encrypted_data);
writer.Finalize();

// this does not do anything for CTR and therefore can be skipped
encryption_state->Finalize(buffer_p, 0, nullptr, 0);
uint32_t nonce = 1;
return {nonce, encrypted_data};
return encrypted_data;
});
}

Expand Down
10 changes: 1 addition & 9 deletions src/core/functions/scalar/struct_encrypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,10 @@ void ExecuteEncryptStructExecutor(Vector &vector, Vector &result, idx_t size, Ex
{"value", LogicalType::INTEGER}
});

StructValue result;

// Use StructWriter to return struct result
StructWriter writer(result, struct_type);
writer.Write<idx_t, int32_t>(0, nonce);
writer.Write<idx_t, T>(1, encrypted_data);
writer.Finalize();

// this does not do anything for CTR and therefore can be skipped
encryption_state->Finalize(buffer_p, 0, nullptr, 0);
uint32_t nonce = 1;
return {nonce, encrypted_data};
return encrypted_data;
});
}

Expand Down

0 comments on commit 17acdf7

Please sign in to comment.