From 10abac43623e2a157ce69182fbd3c0d5523b8232 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Mon, 18 May 2020 10:58:27 +0300 Subject: [PATCH] interop/crypto: update documentation --- pkg/interop/crypto/crypto.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pkg/interop/crypto/crypto.go b/pkg/interop/crypto/crypto.go index abfe586e8..5dbee46ed 100644 --- a/pkg/interop/crypto/crypto.go +++ b/pkg/interop/crypto/crypto.go @@ -1,29 +1,32 @@ +/* +Package crypto provides an interface to VM cryptographic instructions. +*/ package crypto -// Package crypto provides function signatures that can be used inside -// smart contracts that are written in the neo-go framework. - -// SHA1 computes the sha1 hash of b. +// SHA1 computes SHA1 hash of b. It uses `SHA1` VM instruction. func SHA1(b []byte) []byte { return nil } -// SHA256 computes the sha256 hash of b. +// SHA256 computes SHA256 hash of b. It uses `SHA256` VM instruction. func SHA256(b []byte) []byte { return nil } -// Hash160 computes the sha256 + ripemd160 of b. +// Hash160 computes SHA256 + RIPEMD-160 of b, which is commonly used for +// script hashing and address generation. It uses `HASH160` VM instruction. func Hash160(b []byte) []byte { return nil } -// Hash256 computes the sha256^2 hash of b. +// Hash256 computes double SHA256 hash of b (SHA256(SHA256(b))) which is used +// as ID for transactions, blocks and assets. It uses `HASH256` VM instruction. func Hash256(b []byte) []byte { return nil } -// VerifySignature checks that sig is msg's signature with pub. +// VerifySignature checks that sig is correct msg's signature for a given pub +// (serialized public key). It uses `VERIFY` VM instruction. func VerifySignature(msg []byte, sig []byte, pub []byte) bool { return false }