Skip to content

Commit 3698c41

Browse files
Nicklas Warming JacobsenBennett Hardwick
authored andcommitted
remove fn encrypt_primary_key
1 parent 0435a6a commit 3698c41

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

src/crypto/mod.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -129,22 +129,3 @@ impl PreparedPrimaryKey {
129129
}
130130
}
131131
}
132-
133-
pub fn encrypt_primary_key<I: Identifiable>(
134-
k: impl Into<I::PrimaryKey>,
135-
type_name: &str,
136-
sort_key_prefix: Option<&str>,
137-
cipher: &Encryption<impl Credentials<Token = ServiceToken>>,
138-
) -> Result<PrimaryKeyParts, PrimaryKeyError> {
139-
let PrimaryKeyParts { mut pk, mut sk } = k.into().into_parts(type_name, sort_key_prefix);
140-
141-
if I::is_pk_encrypted() {
142-
pk = b64_encode(hmac(&pk, None, cipher)?);
143-
}
144-
145-
if I::is_sk_encrypted() {
146-
sk = b64_encode(hmac(&sk, Some(pk.as_str()), cipher)?);
147-
}
148-
149-
Ok(PrimaryKeyParts { pk, sk })
150-
}

src/encrypted_table/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,6 @@ impl<D> EncryptedTable<D> {
264264
&self,
265265
k: impl Into<E::PrimaryKey>,
266266
) -> Result<DynamoRecordPatch, DeleteError> {
267-
// let PrimaryKeyParts { pk, sk } = encrypt_primary_key::<E>(
268-
// k,
269-
// &E::type_name(),
270-
// E::sort_key_prefix().as_deref(),
271-
// &self.cipher,
272-
// )?;
273-
274267
let PrimaryKeyParts { pk, sk } =
275268
self.encrypt_primary_key_parts(PreparedPrimaryKey::new::<E>(k))?;
276269

0 commit comments

Comments
 (0)