crypto_core_*_from_string: drop the _ro suffix

This commit is contained in:
Frank Denis
2026-02-20 23:23:12 +01:00
parent 8bb79ae24d
commit 38a82863f1
9 changed files with 21 additions and 21 deletions
+2 -2
View File
@@ -166,7 +166,7 @@ _crypto_box_zerobytes 0 1
_crypto_core_ed25519_add 0 1
_crypto_core_ed25519_bytes 0 1
_crypto_core_ed25519_from_string_nu 0 1
_crypto_core_ed25519_from_string_ro 0 1
_crypto_core_ed25519_from_string 0 1
_crypto_core_ed25519_hashbytes 0 1
_crypto_core_ed25519_is_valid_point 0 1
_crypto_core_ed25519_nonreducedscalarbytes 0 1
@@ -203,7 +203,7 @@ _crypto_core_keccak1600_xor_bytes 0 1
_crypto_core_ristretto255_add 0 1
_crypto_core_ristretto255_bytes 0 1
_crypto_core_ristretto255_from_hash 0 1
_crypto_core_ristretto255_from_string_ro 0 1
_crypto_core_ristretto255_from_string 0 1
_crypto_core_ristretto255_hashbytes 0 1
_crypto_core_ristretto255_is_valid_point 0 1
_crypto_core_ristretto255_nonreducedscalarbytes 0 1
File diff suppressed because one or more lines are too long
@@ -97,7 +97,7 @@ crypto_core_ed25519_from_string_nu(unsigned char p[crypto_core_ed25519_BYTES],
}
int
crypto_core_ed25519_from_string_ro(unsigned char p[crypto_core_ed25519_BYTES],
crypto_core_ed25519_from_string(unsigned char p[crypto_core_ed25519_BYTES],
const unsigned char *ctx, size_t ctx_len,
const unsigned char *msg, size_t msg_len,
int hash_alg)
@@ -81,7 +81,7 @@ _string_to_element(unsigned char *p,
}
int
crypto_core_ristretto255_from_string_ro(unsigned char p[crypto_core_ristretto255_BYTES],
crypto_core_ristretto255_from_string(unsigned char p[crypto_core_ristretto255_BYTES],
const unsigned char *ctx, size_t ctx_len,
const unsigned char *msg, size_t msg_len,
int hash_alg)
@@ -53,7 +53,7 @@ int crypto_core_ed25519_from_string_nu(unsigned char p[crypto_core_ed25519_BYTES
__attribute__ ((nonnull(1)));
SODIUM_EXPORT
int crypto_core_ed25519_from_string_ro(unsigned char p[crypto_core_ed25519_BYTES],
int crypto_core_ed25519_from_string(unsigned char p[crypto_core_ed25519_BYTES],
const unsigned char *ctx, size_t ctx_len,
const unsigned char *msg, size_t msg_len,
int hash_alg)
@@ -47,7 +47,7 @@ int crypto_core_ristretto255_from_hash(unsigned char *p,
__attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_core_ristretto255_from_string_ro(unsigned char p[crypto_core_ristretto255_BYTES],
int crypto_core_ristretto255_from_string(unsigned char p[crypto_core_ristretto255_BYTES],
const unsigned char *ctx, size_t ctx_len,
const unsigned char *msg, size_t msg_len,
int hash_alg)
+5 -5
View File
@@ -201,13 +201,13 @@ test_from_string(void)
printf("crypto_core_ed25519_from_string_nu() failed\n");
}
} else {
if (crypto_core_ed25519_from_string_ro(
if (crypto_core_ed25519_from_string(
y,
(const unsigned char *) "QUUX-V01-CS02-with-edwards25519_XMD:SHA-512_ELL2_RO_",
sizeof("QUUX-V01-CS02-with-edwards25519_XMD:SHA-512_ELL2_RO_") - 1U,
(const unsigned char *) test_data[i].msg,
strlen(test_data[i].msg), H2CHASH) != 0) {
printf("crypto_core_ed25519_from_string_ro() failed\n");
printf("crypto_core_ed25519_from_string() failed\n");
}
}
if (((y[crypto_core_ed25519_BYTES - 1U] >> 7) & 1) != expected_x_sign) {
@@ -228,9 +228,9 @@ test_from_string(void)
3U, H2CHASH) != 0 ||
crypto_core_ed25519_from_string_nu(y, (const unsigned char *) "", 0U,
guard_page, 0U, H2CHASH) != 0 ||
crypto_core_ed25519_from_string_ro(
crypto_core_ed25519_from_string(
y, NULL, 0U, (const unsigned char *) "msg", 3U, H2CHASH) != 0 ||
crypto_core_ed25519_from_string_ro(y, (const unsigned char *) "", 0U,
crypto_core_ed25519_from_string(y, (const unsigned char *) "", 0U,
guard_page, 0U, H2CHASH) != 0) {
printf("Failed with empty parameters");
}
@@ -244,7 +244,7 @@ test_from_string(void)
sodium_bin2hex(y_hex, crypto_core_ed25519_BYTES * 2U + 1U, y,
crypto_core_ed25519_BYTES);
printf("NU with oversized context: %s\n", y_hex);
crypto_core_ed25519_from_string_ro(y, (const unsigned char *) oversized_ctx,
crypto_core_ed25519_from_string(y, (const unsigned char *) oversized_ctx,
oversized_ctx_len - 1U,
(const unsigned char *) "msg", 3U,
H2CHASH);
+7 -7
View File
@@ -121,7 +121,7 @@ test_scalar_from_string(void)
#define H2CHASH crypto_core_ristretto255_H2CSHA512
static void
test_from_string_ro(void)
test_from_string(void)
{
unsigned char *p, *expected, *input;
char *p_hex, *expected_hex;
@@ -155,9 +155,9 @@ test_from_string_ro(void)
sodium_hex2bin(expected, crypto_core_ristretto255_BYTES,
test_data[i].expected_hex, 64U, NULL, NULL, NULL);
if (crypto_core_ristretto255_from_string_ro(
if (crypto_core_ristretto255_from_string(
p, dst, dst_len, input, input_len, H2CHASH) != 0) {
printf("crypto_core_ristretto255_from_string_ro() failed (test #%u)\n",
printf("crypto_core_ristretto255_from_string() failed (test #%u)\n",
(unsigned) i);
continue;
}
@@ -171,16 +171,16 @@ test_from_string_ro(void)
}
}
if (crypto_core_ristretto255_from_string_ro(
if (crypto_core_ristretto255_from_string(
p, NULL, 0U, (const unsigned char *) "msg", 3U, H2CHASH) != 0 ||
crypto_core_ristretto255_from_string_ro(
crypto_core_ristretto255_from_string(
p, (const unsigned char *) "", 0U, guard_page, 0U, H2CHASH) != 0) {
printf("Failed with empty parameters\n");
}
oversized_ctx = (char *) sodium_malloc(oversized_ctx_len);
memset(oversized_ctx, 'X', oversized_ctx_len);
crypto_core_ristretto255_from_string_ro(
crypto_core_ristretto255_from_string(
p, (const unsigned char *) oversized_ctx, oversized_ctx_len - 1U,
(const unsigned char *) "msg", 3U, H2CHASH);
sodium_bin2hex(p_hex, crypto_core_ristretto255_BYTES * 2U + 1U,
@@ -199,7 +199,7 @@ int
main(void)
{
test_scalar_from_string();
test_from_string_ro();
test_from_string();
printf("OK\n");
+2 -2
View File
@@ -195,7 +195,7 @@ crypto_box_zerobytes
crypto_core_ed25519_add
crypto_core_ed25519_bytes
crypto_core_ed25519_from_string_nu
crypto_core_ed25519_from_string_ro
crypto_core_ed25519_from_string
crypto_core_ed25519_hashbytes
crypto_core_ed25519_is_valid_point
crypto_core_ed25519_nonreducedscalarbytes
@@ -232,7 +232,7 @@ crypto_core_keccak1600_xor_bytes
crypto_core_ristretto255_add
crypto_core_ristretto255_bytes
crypto_core_ristretto255_from_hash
crypto_core_ristretto255_from_string_ro
crypto_core_ristretto255_from_string
crypto_core_ristretto255_hashbytes
crypto_core_ristretto255_is_valid_point
crypto_core_ristretto255_nonreducedscalarbytes