I want to create a block that fulfill the Proof of Work requirement. After reading sparse documentation my understanding on how to do it is:
1- Serialize the block(message) excluding the 8-byte Nonce and compute the BLAKE2b-256 hash of this. Convert the hash into its 192-trit b1t6 encoding
2- Propose a random 8-byte Nonce and convert it into its 48-trit b1t6 encoding and append it to the hash trits.
3- Add a padding of three zero trits to create a 243-trit string.
4- Compute the Curl-P-81 hash of the 243-trit string.
5- Count the number of trailing zero trits in the hash.
6- Then, the PoW score equals 3#zeros / size(message).
7- If the PoW score is smaller than the minPowScore of the node info repeat the process from step 2, else the proposed nonce is sufficient to fulfill Proof of work.
My question is: is this procedure the correct one to fulfill Proof of work on the client. If it is the correct one, where can i get Curl-P-81 function or do step 4. I have followed this tip, but i can not find the Curl-P hashing function.
Thank you for your time.