Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
Revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jiep committed Feb 18, 2022
1 parent 6e9a100 commit c6387db
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/gake.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ void init_parties(OQS_KEM* kem, Party* parties, int num_parties) {
init_to_zero(parties[i].xs[j], kem->length_shared_secret);
}

parties[i].sid = malloc(SECRET_KEY_LENGTH);
parties[i].sk = malloc(SECRET_KEY_LENGTH);
parties[i].sid = malloc(kem->length_shared_secret);
parties[i].sk = malloc(kem->length_shared_secret);
parties[i].key_left = malloc(kem->length_shared_secret);
parties[i].key_right = malloc(kem->length_shared_secret);
init_to_zero(parties[i].sid, kem->length_shared_secret);
Expand Down Expand Up @@ -199,8 +199,8 @@ void free_parties(Party* parties, int num_parties) {
free(parties[i].pids);
free(parties[i].coins);
free(parties[i].xs);
OQS_MEM_secure_free(parties[i].sid, SECRET_KEY_LENGTH);
OQS_MEM_secure_free(parties[i].sk, SECRET_KEY_LENGTH);
free(parties[i].sid);
free(parties[i].sk);
free(parties[i].key_left);
free(parties[i].key_right);
free(parties[i].public_key);
Expand Down
2 changes: 0 additions & 2 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#define PID_LENGTH 20
#endif

#define SECRET_KEY_LENGTH 32

int mod(int x, int y);
void itoa(int n, char s[]);
void reverse(char s[]);
Expand Down
4 changes: 2 additions & 2 deletions test/test_gake.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ int main(int argc, char** argv){
compute_masterkey(kem, pointer_to_parties, NUM_PARTIES, kem->length_shared_secret);

// Compute session key and session identifier
compute_sk_sid(kem, pointer_to_parties, NUM_PARTIES, SECRET_KEY_LENGTH);
compute_sk_sid(kem, pointer_to_parties, NUM_PARTIES, kem->length_shared_secret);

if (verbose) {
print_parties(kem, pointer_to_parties, NUM_PARTIES, SHOW);
}

// Check all keys are correct
int res = check_all_keys(pointer_to_parties, NUM_PARTIES, SECRET_KEY_LENGTH);
int res = check_all_keys(pointer_to_parties, NUM_PARTIES, kem->length_shared_secret);

if (res == 0) {
printf("All keys are equal!\n");
Expand Down
4 changes: 2 additions & 2 deletions test/test_speed_ake.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ static OQS_STATUS ake_speed_wrapper(const char *method_name, int iterations, boo
kB1 = malloc(kem->length_shared_secret);
cB2 = malloc(kem->length_ciphertext);
kB2 = malloc(kem->length_shared_secret);
skB = malloc(SECRET_KEY_LENGTH);
skB = malloc(kem->length_shared_secret);
kA1_prime = malloc(kem->length_shared_secret);
skA = malloc(SECRET_KEY_LENGTH);
skA = malloc(kem->length_shared_secret);
ekA1 = malloc(kem->length_public_key);
dkA1 = malloc(kem->length_secret_key);
ekB1 = malloc(kem->length_public_key);
Expand Down

0 comments on commit c6387db

Please sign in to comment.