Skip to content

Commit

Permalink
updated to add env varaibles
Browse files Browse the repository at this point in the history
  • Loading branch information
Segue21 committed May 26, 2024
1 parent 87ad881 commit bb57bbb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ jobs:
with:
node-version: '20'


- name: Load environment variables
run: echo "VITE_APP_BASE_URL=/zama_bounty/" >> $GITHUB_ENV
run: |
echo "VITE_APP_BASE_URL=/zama_bounty/" >> $GITHUB_ENV
echo "VITE_LOCAL_IPFS_API_URL=${{ secrets.VITE_LOCAL_IPFS_API_URL }}" >> $GITHUB_ENV
echo "VITE_LOCAL_IPFS_GATEWAY_URL=${{ secrets.VITE_LOCAL_IPFS_GATEWAY_URL }}" >> $GITHUB_ENV
- name: Install dependencies
run: npm ci
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ In more detail, the function `displayGallery` automatically performs the followi
1. **Generation of the target public Key for Reencryption** :
- The user _shared-with_ of a token needs to receive the `fileKey` encrypted under an encryption key `publicKey` which it owns. It thus generates an encryption key pair (unless it has already one associated to the contract) using the function `getSignature(contractAddress, account)`.


> This function is borrowed from [fhevmjs.ts](https://github.com/zama-ai/fhevm-react-template/blob/main/src/fhevmjs.ts).

```javascript
Expand Down
8 changes: 0 additions & 8 deletions src/components/Utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const LOCAL_IPFS_GATEWAY_URL = (import.meta.env.VITE_LOCAL_IPFS_GATEWAY_URL || '
const PINATA_JWT = import.meta.env.VITE_PINATA_JWT as string;



export interface CiphFile {
ciphFileData: string; // Base64 encoded string
ciphFileMetadata: string; // Base64 encoded string
Expand All @@ -24,9 +23,6 @@ export interface CiphFile {
};
}

// export interface EncryptedFile extends CiphFile {
// encryptedFileKey: Uint8Array[]; // Array of Uint8Array, each representing a key segment resulting from instance.encrypt64
// }

export interface DecryptedFileMetaData {
file: File;
Expand Down Expand Up @@ -67,8 +63,6 @@ export async function encryptFile(file: File, key: CryptoKey): Promise<CiphFile>
metadataArrayBuffer
);

// console.log("metadataString", metadataString);

const ciphFile: CiphFile = {
ciphFileData: bufferToBase64(ciphFileData),
ciphFileMetadata: bufferToBase64(ciphFileMetadata),
Expand All @@ -88,10 +82,8 @@ export async function encryptFile(file: File, key: CryptoKey): Promise<CiphFile>

export async function decryptFile(ciphFile: CiphFile, key: CryptoKey): Promise<DecryptedFileMetaData> {
try {
// Ensure the counter is a Uint8Array
const counter = convertCounterObjectToUint8Array(ciphFile.encryptionAlgorithm.counter);

// console.log("Decrypted counter : ", encryptionAlgorithm.counter);
// Decrypt the data using the provided key and algorithm details
const decryptedData = await window.crypto.subtle.decrypt(
{
Expand Down

0 comments on commit bb57bbb

Please sign in to comment.