TerenceGe / sr25519-donna

Pure C implementation of schnorrkel algorithm (sr25519)
Apache License 2.0
16 stars 5 forks source link

The test cases in the main function are not running correctly #16

Open yazhou71021 opened 4 years ago

yazhou71021 commented 4 years ago
  1. 1
  2. The screenshot above is the result of running test case 'creates_pair_from_known_seed', the public key and the expected are not equal, other test cases are not running correctly. where might the problem lie?
TerenceGe commented 4 years ago
Screen Shot 2020-09-06 at 4 08 53 PM

It's running correctly in my mac, but I'm not test it in windows yet. Can you provide more details about your machine, os version and build options.

yazhou71021 commented 4 years ago

image It's the problem with this function, but I don't know the specific reason. I replaced this function with my scalarmult function and there is no problem. My configuration here is win7-64 bit, vs2010.

kuafuwang commented 3 years ago

void merlin_transcript_commit_bytes(merlin_transcript* mctx, const uint8_t* label, size_t label_len, const uint8_t* message, size_t message_len) { uint64_t message_len_bytes = message_len; strobe128_meta_ad(&mctx->sctx, label, label_len, 0); strobe128_meta_ad(&mctx->sctx, (uint8_t*)&message_len_bytes, 4, 1); strobe128_ad(&mctx->sctx, message, message_len, 0); } 在多处调用strobe128_meta_ad 的地方。把整形转成char*类型,会有大小端的问题。