mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: replace []byte with []u8
This commit is contained in:
@ -19,7 +19,7 @@ pub fn constant_time_select(v int, x int, y int) int {
|
||||
// constant_time_compare returns 1 when x and y have equal contents.
|
||||
// The runtime of this function is proportional of the length of x and y.
|
||||
// It is *NOT* dependent on their content.
|
||||
pub fn constant_time_compare(x []byte, y []byte) int {
|
||||
pub fn constant_time_compare(x []u8, y []u8) int {
|
||||
if x.len != y.len {
|
||||
return 0
|
||||
}
|
||||
@ -33,7 +33,7 @@ pub fn constant_time_compare(x []byte, y []byte) int {
|
||||
// constant_time_copy copies the contents of y into x, when v == 1.
|
||||
// When v == 0, x is left unchanged. this function is undefined, when
|
||||
// v takes any other value
|
||||
pub fn constant_time_copy(v int, mut x []byte, y []byte) {
|
||||
pub fn constant_time_copy(v int, mut x []u8, y []u8) {
|
||||
if x.len != y.len {
|
||||
panic('subtle: arrays have different lengths')
|
||||
}
|
||||
|
Reference in New Issue
Block a user