Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions scripts/demo/load_lineitem_enc.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ATTACH 'lineitem_enc_512.db' as demo_lineitem_enc_512;
CREATE SECRET key_2 (
TYPE VCRYPT,
TOKEN 'ABCDEFGHIJKLMNOP',
LENGTH 16
);
CREATE TABLE demo_lineitem_enc_512.lineitem AS
SELECT
encrypt(l_orderkey, 'key_2') AS l_orderkey,
encrypt(l_partkey, 'key_2') AS l_partkey,
encrypt(l_suppkey, 'key_2') AS l_suppkey,
encrypt(l_linenumber, 'key_2') AS l_linenumber,
l_quantity,
l_extendedprice,
l_discount,
l_tax,
l_returnflag,
l_linestatus,
encrypt(l_shipdate, 'key_2') AS l_shipdate,
encrypt(l_commitdate, 'key_2') AS l_commitdate,
encrypt(l_receiptdate, 'key_2') AS l_receiptdate,
encrypt(l_shipinstruct, 'key_2') AS l_shipinstruct,
encrypt(l_shipmode, 'key_2') AS l_shipmode,
l_comment
FROM lineitem;
CHECKPOINT;
26 changes: 26 additions & 0 deletions scripts/demo/load_lineitem_naive.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ATTACH 'lineitem_naive.db' as demo_lineitem_naive;
CREATE SECRET key_2 (
TYPE VCRYPT,
TOKEN 'ABCDEFGHIJKLMNOP',
LENGTH 16
);
CREATE TABLE demo_lineitem_naive.lineitem AS
SELECT
encrypt_naive(l_orderkey, 'key_2') AS l_orderkey,
encrypt_naive(l_partkey, 'key_2') AS l_partkey,
encrypt_naive(l_suppkey, 'key_2') AS l_suppkey,
encrypt_naive(l_linenumber, 'key_2') AS l_linenumber,
l_quantity,
l_extendedprice,
l_discount,
l_tax,
l_returnflag,
l_linestatus,
encrypt_naive(l_shipdate, 'key_2') AS l_shipdate,
encrypt_naive(l_commitdate, 'key_2') AS l_commitdate,
encrypt_naive(l_receiptdate, 'key_2') AS l_receiptdate,
encrypt_naive(l_shipinstruct, 'key_2') AS l_shipinstruct,
encrypt_naive(l_shipmode, 'key_2') AS l_shipmode,
l_comment
FROM lineitem;
CHECKPOINT;
11 changes: 11 additions & 0 deletions scripts/demo/load_sf1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ATTACH 'demo_sf1.db' as demo_sf1;
CALL dbgen(sf=1);
CREATE table demo_sf1.lineitem AS SELECT * from lineitem;
CREATE TABLE demo_sf1.region AS SELECT * FROM region;
CREATE TABLE demo_sf1.customer AS SELECT * FROM customer;
CREATE TABLE demo_sf1.nation AS SELECT * FROM nation;
CREATE TABLE demo_sf1.supplier AS SELECT * FROM supplier;
CREATE TABLE demo_sf1.part AS SELECT * FROM part;
CREATE TABLE demo_sf1.partsupp AS SELECT * FROM partsupp;
CREATE TABLE demo_sf1.orders AS SELECT * FROM orders;
CHECKPOINT;
1 change: 1 addition & 0 deletions src/core/functions/scalar/decrypt_vectorized.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ static void DecryptData(DataChunk &args, ExpressionState &state,
counter_vec_u, cipher_vec_u, value_vec_u, result,
lstate, *key, same_nonce, size);
case LogicalTypeId::INTEGER:
case LogicalTypeId::DATE:
return DecryptDataFixedSize<int32_t>(nonce_hi_u.sel, nonce_lo_u.sel, nonce_hi_data, nonce_lo_data, FlatVector::Validity(result),
counter_vec_u, cipher_vec_u, value_vec_u, result,
lstate, *key, same_nonce, size);
Expand Down
2 changes: 1 addition & 1 deletion src/include/vcrypt/core/functions/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "vcrypt/common.hpp"
#include "vcrypt/core/functions/function_data/encrypt_function_data.hpp"

#define BATCH_SIZE 256
#define BATCH_SIZE 128

namespace vcrypt {

Expand Down
1 change: 1 addition & 0 deletions src/include/vcrypt/core/module.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct CoreModule {
public:
static void Register(DatabaseInstance &db);
static void RegisterType(DatabaseInstance &db);
static void SetBatchSize(uint32_t batch_size);
};

} // namespace core
Expand Down
1 change: 1 addition & 0 deletions src/vcrypt_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ static void LoadInternal(DatabaseInstance &instance) {

void VcryptExtension::Load(DuckDB &db) {
LoadInternal(*db.instance); }

std::string VcryptExtension::Name() { return "vcrypt"; }

std::string VcryptExtension::Version() const {
Expand Down
Loading