crypto: make public all Digest.checksum() methods

pull/13387/merge
Delyan Angelov 2022-04-15 08:56:01 +03:00
parent 3b36f16365
commit c3ee4fb2a2
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
3 changed files with 6 additions and 4 deletions

View File

@ -102,8 +102,8 @@ pub fn (d &Digest) sum(b_in []byte) []byte {
return b_out
}
// checksum returns the byte checksum of the `Digest`.
fn (mut d Digest) checksum() []byte {
// checksum returns the current byte checksum of the `Digest`.
pub fn (mut d Digest) checksum() []byte {
mut len := d.len
// Padding. Add a 1 bit and 0 bits until 56 bytes mod 64.
mut tmp := []byte{len: (64)}

View File

@ -142,7 +142,8 @@ pub fn (d &Digest) sum(b_in []byte) []byte {
return b_out
}
fn (mut d Digest) checksum() []byte {
// checksum returns the current byte checksum of the Digest.
pub fn (mut d Digest) checksum() []byte {
mut len := d.len
// Padding. Add a 1 bit and 0 bits until 56 bytes mod 64.
mut tmp := []byte{len: (64)}

View File

@ -214,7 +214,8 @@ pub fn (d &Digest) sum(b_in []byte) []byte {
return b_out
}
fn (mut d Digest) checksum() []byte {
// checksum returns the current byte checksum of the Digest.
pub fn (mut d Digest) checksum() []byte {
// Padding. Add a 1 bit and 0 bits until 112 bytes mod 128.
mut len := d.len
mut tmp := []byte{len: (128)}