crypto: make Digest.sum() and Digest.write() private in md5 and sha1 (#8270)
parent
500ebf77e4
commit
f2c6735d92
|
@ -51,7 +51,7 @@ pub fn new() &Digest {
|
|||
return d
|
||||
}
|
||||
|
||||
pub fn (mut d Digest) write(p_ []byte) int {
|
||||
fn (mut d Digest) write(p_ []byte) int {
|
||||
unsafe {
|
||||
mut p := p_
|
||||
nn := p.len
|
||||
|
@ -85,7 +85,7 @@ pub fn (mut d Digest) write(p_ []byte) int {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn (d &Digest) sum(b_in []byte) []byte {
|
||||
fn (d &Digest) sum(b_in []byte) []byte {
|
||||
// Make a copy of d so that caller can keep writing and summing.
|
||||
mut d0 := *d
|
||||
hash := d0.checksum()
|
||||
|
|
|
@ -55,7 +55,7 @@ pub fn new() &Digest {
|
|||
}
|
||||
|
||||
[manualfree]
|
||||
pub fn (mut d Digest) write(p_ []byte) int {
|
||||
fn (mut d Digest) write(p_ []byte) int {
|
||||
nn := p_.len
|
||||
unsafe {
|
||||
mut p := p_
|
||||
|
@ -89,7 +89,7 @@ pub fn (mut d Digest) write(p_ []byte) int {
|
|||
return nn
|
||||
}
|
||||
|
||||
pub fn (d &Digest) sum(b_in []byte) []byte {
|
||||
fn (d &Digest) sum(b_in []byte) []byte {
|
||||
// Make a copy of d so that caller can keep writing and summing.
|
||||
mut d0 := *d
|
||||
hash := d0.checksum()
|
||||
|
|
Loading…
Reference in New Issue