mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vlib: run vfmt over vlib files, so that v doc -m vlib/ can run without warnings
This commit is contained in:
@@ -11,7 +11,7 @@ const (
|
||||
)
|
||||
|
||||
// Returns an HMAC byte array, depending on the hash algorithm used
|
||||
pub fn new(key, data []byte, hash_func fn (bytes []byte) []byte, blocksize int) []byte {
|
||||
pub fn new(key []byte, data []byte, hash_func fn (bytes []byte) []byte, blocksize int) []byte {
|
||||
mut b_key := []byte{}
|
||||
if key.len <= blocksize {
|
||||
b_key = key.clone() // TODO: remove .clone() once https://github.com/vlang/v/issues/6604 gets fixed
|
||||
@@ -39,6 +39,6 @@ pub fn new(key, data []byte, hash_func fn (bytes []byte) []byte, blocksize int)
|
||||
// equal compares 2 MACs for equality, without leaking timing info
|
||||
// NB: if the lengths of the 2 MACs are different, probably a completely different
|
||||
// hash function was used to generate them => no useful timing information.
|
||||
pub fn equal(mac1, mac2 []byte) bool {
|
||||
pub fn equal(mac1 []byte, mac2 []byte) bool {
|
||||
return subtle.constant_time_compare(mac1, mac2) == 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user