Skip to content

Commit

Permalink
update naming ByteView -> ctt_span following C++20 naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindaar authored and mratsim committed May 18, 2024
1 parent 85eb702 commit 824ff7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples-c/ethereum_bls_signatures.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int main(){

// try to use batch verify; We just reuse the data from above 3 times
const ctt_eth_bls_pubkey pkeys[3] = { pubkey, pubkey, pubkey };
ByteView messages[3] = { // already hashed message, reuse 3 times
ctt_span messages[3] = { // already hashed message, reuse 3 times
{ message, 32 },
{ message, 32 },
{ message, 32 }
Expand Down
8 changes: 4 additions & 4 deletions include/constantine/protocols/ethereum_bls_signatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ static const char* ctt_eth_bls_status_to_string(ctt_eth_bls_status status) {
// type View*[byte] = object # with T = byte
// data: ptr UncheckedArray[byte] # 8 bytes
// len*: int # 8 bytes (Nim `int` is a 64bit int type)
typedef struct { byte* data; size_t len; } ByteView;
// `span` naming following C++20 std::span<T>
typedef struct { byte* data; size_t len; } ctt_span;

// Comparisons
// ------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -256,7 +257,7 @@ ctt_eth_bls_status ctt_eth_bls_fast_aggregate_verify(const ctt_eth_bls_pubkey pu
* 2. Augmentation or Proof of possessions must used for each public keys.
*/
ctt_eth_bls_status aggregate_verify(const ctt_eth_bls_pubkey* pubkeys,
const ByteView messages[],
const ctt_span messages[],
ptrdiff_t len,
const ctt_eth_bls_signature* aggregate_sig) __attribute__((warn_unused_result));

Expand Down Expand Up @@ -286,8 +287,7 @@ ctt_eth_bls_status aggregate_verify(const ctt_eth_bls_pubkey* pubkeys,
*/

ctt_eth_bls_status ctt_eth_bls_batch_verify(const ctt_eth_bls_pubkey pubkeys[],
//const struct { byte* data; size_t len; } messages[],
const ByteView messages[],
const ctt_span messages[],
const ctt_eth_bls_signature signatures[],
ptrdiff_t len,
const byte secure_random_bytes[32]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern "C" {
ctt_eth_bls_status ctt_eth_bls_batch_verify_parallel(
const ctt_threadpool* tp,
const ctt_eth_bls_pubkey pubkey[],
const ByteView messages[],
const ctt_span messages[],
const ctt_eth_bls_signature sig[],
ptrdiff_t len,
const byte secure_random_bytes[32]
Expand Down

0 comments on commit 824ff7c

Please sign in to comment.