AluVM / rust-aluvm

Rust implementation of AluVM (RISC functional machine)
https://docs.rs/aluvm
Apache License 2.0
58 stars 22 forks source link

Implement BLAKE3 opcodes #68

Open dr-orlovsky opened 1 year ago

dr-orlovsky commented 1 year ago

It must be checked not to break WASM compatibility: https://github.com/strict-types/strict-types/pull/10

crisdut commented 10 months 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

dr-orlovsky commented 9 months ago

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

crisdut commented 9 months ago

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.

fengjian commented 5 months ago

@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?

dr-orlovsky commented 5 months ago

No, I do not have any other suggestions.