Research Article

ROS-Ethereum: A Convenient Tool to Bridge ROS and Blockchain (Ethereum)

Algorithm 3

The pseudocode of the SM2 key derivation function algorithm.
(i)Input: the shared secret bit string , the length of derived key data
(ii)Output: key data bit string of length
(iii)Begin
(iv)bitstring
(v)bitstring
(vi)bitstring
(vii)
(viii)For
(ix)
(x)If is the type of Integer
(xi)
(xii)Else
(xiii)
(xiv)
(xv)
(xvi)For
 
 
(xvii)End
(xviii)SM2 Encrypt: The variable is the message to be encrypted, and the variable is the encrypted ciphertext, both of which are bit string types. The variable is the public key of the point type, and the variable is the random integer generated by the random number generator. The pseudo of SM2 encrypt is shown in Algorithm 4.