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:
committed by
Alexander Medvednikov
parent
c0911ea74b
commit
43070412f7
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user