1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

implement crypto.sha256 + some crypto cleanup

This commit is contained in:
joe-conigliaro
2019-07-18 18:50:05 +10:00
committed by Alexander Medvednikov
parent c0911ea74b
commit 43070412f7
8 changed files with 424 additions and 38 deletions

View File

@@ -48,7 +48,7 @@ fn (d mut Digest) reset() {
d.len = u64(0)
}
// new returns a new hash.Hash computing the MD5 checksum.
// new returns a new Digest (implementing hash.Hash) computing the MD5 checksum.
pub fn new() *Digest {
mut d := &Digest{}
d.reset()

View File

@@ -17,6 +17,7 @@ fn block_generic(dig &Digest, p []byte) {
mut b := dig.s[1]
mut c := dig.s[2]
mut d := dig.s[3]
for i := 0; i <= p.len-BlockSize; i += BlockSize {
mut q := p.right(i)
q = q.left(BlockSize)