From 64debfab8b5032930d06f427c377b5b543dbddcd Mon Sep 17 00:00:00 2001
From: Cameron Pickett <pickett@meta.com>
Date: Tue, 27 Aug 2024 13:39:47 -0700
Subject: [PATCH] Upgrade base64 to 0.21

Reviewed By: zertosh

Differential Revision: D61737689
---
 protocol/src/dpmc/helper.rs  | 4 +++-
 protocol/src/dpmc/partner.rs | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/protocol/src/dpmc/helper.rs b/protocol/src/dpmc/helper.rs
index 20877a5..93162c3 100644
--- a/protocol/src/dpmc/helper.rs
+++ b/protocol/src/dpmc/helper.rs
@@ -10,6 +10,8 @@ use std::path::Path;
 use std::sync::Arc;
 use std::sync::RwLock;
 
+use base64::engine::general_purpose::URL_SAFE;
+use base64::Engine;
 use common::permutations::gen_permute_pattern;
 use common::permutations::permute;
 use common::permutations::undo_permute;
@@ -162,7 +164,7 @@ impl HelperDpmcProtocol for HelperDpmc {
                         let y = self.ec_cipher.to_bytes(&x);
                         y[0].buffer.clone()
                     };
-                    base64::encode_config(aes_key_bytes, base64::URL_SAFE)
+                    URL_SAFE.encode(aes_key_bytes)
                 };
 
                 let alpha_t = {
diff --git a/protocol/src/dpmc/partner.rs b/protocol/src/dpmc/partner.rs
index 6ffaa15..e3b2ecb 100644
--- a/protocol/src/dpmc/partner.rs
+++ b/protocol/src/dpmc/partner.rs
@@ -5,6 +5,8 @@ use std::convert::TryInto;
 use std::sync::Arc;
 use std::sync::RwLock;
 
+use base64::engine::general_purpose::URL_SAFE;
+use base64::Engine;
 use common::permutations::gen_permute_pattern;
 use common::permutations::permute;
 use common::timer;
@@ -120,7 +122,7 @@ impl PartnerDpmc {
                         .ec_cipher
                         .to_bytes(&[self.partner_scalar * (*helper_pk)]);
                     let aes_key_bytes = x[0].buffer.clone();
-                    base64::encode_config(aes_key_bytes, base64::URL_SAFE)
+                    URL_SAFE.encode(aes_key_bytes)
                 };
                 Ok(())
             }