Open dr-orlovsky opened 1 year ago
Hello @dr-orlovsky, how are you?
I want to learn about AluVM, and there is nothing better than solving a problem as it is.
I implemented Blake3 in AluVM, but how do I test it?
I didn't find automated tests for hash functions, and I was unsure how to do the tests.
Thanks
Thank you for your interest! The only way to test it is to find test vectors for BLAKE3 and write unit tests. Or, in more simple way, you can hash with Blake3 API directly - and compare result with what you receive from AluVM script executing that op code
Thank you for your interest! The only way to test it is to find test vectors for BLAKE3 and write unit tests. Or, in more simple way, you can hash with Blake3 API directly - and compare result with what you receive from AluVM script executing that op code
Great!
Thank you.
@dr-orlovsky
Hi If you want to implement BLAKE3 opcode, I recommend using BLAKE3. The opcode is defined as follows:
// ### Hashing (BPDIGEST)
pub const INSTR_RIPEMD: u8 = 0b10_000_000;
pub const INSTR_SHA256: u8 = 0b10_000_001;
pub const INSTR_SHA512: u8 = 0b10_000_010;
pub const INSTR_BLAKE3: u8 = 0b10_000_100;
Do you have any other suggestions for implementing BLAKE3 opcode?
No, I do not have any other suggestions.
It must be checked not to break WASM compatibility: https://github.com/strict-types/strict-types/pull/10