rename functions to be more consistent

This commit is contained in:
Hubert Chathi 2019-03-13 22:39:21 -04:00
parent 2589d1b17b
commit 0348f06a56
3 changed files with 8 additions and 8 deletions

View file

@ -238,8 +238,8 @@ size_t olm_pk_signing_key_from_seed(
void * seed, size_t seed_length void * seed, size_t seed_length
); );
size_t olm_pk_sign_seed_length(void); size_t olm_pk_signing_seed_length(void);
size_t olm_pk_sign_public_key_length(void); size_t olm_pk_signing_public_key_length(void);
size_t olm_pk_signature_length(); size_t olm_pk_signature_length();

View file

@ -302,7 +302,7 @@ PkSigning.prototype['init_with_seed'] = restore_stack(function (seed) {
Module['HEAPU8'].set(seed, seed_buffer); Module['HEAPU8'].set(seed, seed_buffer);
var pubkey_length = pk_signing_method( var pubkey_length = pk_signing_method(
Module['_olm_pk_sign_public_key_length'] Module['_olm_pk_signing_public_key_length']
)(); )();
var pubkey_buffer = stack(pubkey_length + NULL_BYTE_PADDING_LENGTH); var pubkey_buffer = stack(pubkey_length + NULL_BYTE_PADDING_LENGTH);
try { try {
@ -320,7 +320,7 @@ PkSigning.prototype['init_with_seed'] = restore_stack(function (seed) {
PkSigning.prototype['generate_seed'] = restore_stack(function () { PkSigning.prototype['generate_seed'] = restore_stack(function () {
var random_length = pk_signing_method( var random_length = pk_signing_method(
Module['_olm_pk_sign_seed_length'] Module['_olm_pk_signing_seed_length']
)(); )();
var random_buffer = random_stack(random_length); var random_buffer = random_stack(random_length);
var key_arr = new Uint8Array( var key_arr = new Uint8Array(

View file

@ -436,11 +436,11 @@ size_t olm_clear_pk_signing(OlmPkSigning *sign) {
return sizeof(OlmPkSigning); return sizeof(OlmPkSigning);
} }
size_t olm_pk_sign_seed_length(void) { size_t olm_pk_signing_seed_length(void) {
return ED25519_RANDOM_LENGTH; return ED25519_RANDOM_LENGTH;
} }
size_t olm_pk_sign_public_key_length(void) { size_t olm_pk_signing_public_key_length(void) {
return olm::encode_base64_length(ED25519_PUBLIC_KEY_LENGTH); return olm::encode_base64_length(ED25519_PUBLIC_KEY_LENGTH);
} }
@ -449,12 +449,12 @@ size_t olm_pk_signing_key_from_seed(
void * pubkey, size_t pubkey_length, void * pubkey, size_t pubkey_length,
void * seed, size_t seed_length void * seed, size_t seed_length
) { ) {
if (pubkey_length < olm_pk_sign_public_key_length()) { if (pubkey_length < olm_pk_signing_public_key_length()) {
signing->last_error = signing->last_error =
OlmErrorCode::OLM_OUTPUT_BUFFER_TOO_SMALL; OlmErrorCode::OLM_OUTPUT_BUFFER_TOO_SMALL;
return std::size_t(-1); return std::size_t(-1);
} }
if (seed_length < olm_pk_sign_seed_length()) { if (seed_length < olm_pk_signing_seed_length()) {
signing->last_error = signing->last_error =
OlmErrorCode::OLM_INPUT_BUFFER_TOO_SMALL; OlmErrorCode::OLM_INPUT_BUFFER_TOO_SMALL;
return std::size_t(-1); return std::size_t(-1);