Skip to content

Commit

Permalink
Account.create() will generate a prekey along with identity keys (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
anunayk committed May 8, 2023
1 parent 67f3a01 commit e7c1b50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ std::size_t olm::Account::remove_key(
}

std::size_t olm::Account::new_account_random_length() const {
return ED25519_RANDOM_LENGTH + CURVE25519_RANDOM_LENGTH;
return ED25519_RANDOM_LENGTH + CURVE25519_RANDOM_LENGTH + generate_prekey_random_length();
}

std::size_t olm::Account::new_account(
Expand All @@ -99,6 +99,8 @@ std::size_t olm::Account::new_account(
_olm_crypto_ed25519_generate_key(random, &identity_keys.ed25519_key);
random += ED25519_RANDOM_LENGTH;
_olm_crypto_curve25519_generate_key(random, &identity_keys.curve25519_key);
random += CURVE25519_RANDOM_LENGTH;
generate_prekey(random, generate_prekey_random_length());

return 0;
}
Expand Down

0 comments on commit e7c1b50

Please sign in to comment.