XU XUv0.16.0

#crypto/subtle

import: #crypto/subtle

counts: 5 functions, 0 methods, 0 types, 0 constants, 0 method sets

Constant-time-shaped helpers; the backend does not guarantee timing.

constant_time_compare

XuAPI
pub fn constant_time_compare(x &string, y &string) int

Purpose

Constant time compare.

Parameters

x &string
value (read-only borrow; caller keeps the original; type &string)
y &string
value (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

constant_time_byte_eq

XuAPI
pub fn constant_time_byte_eq(x int, y int) int

Purpose

Compare two bytes in constant time.

Parameters

x int
value (int)
y int
value (int)

Returns

int — a value of this type

constant_time_eq

XuAPI
pub fn constant_time_eq(x int, y int) int

Purpose

Compare slices in constant time.

Parameters

x int
value (int)
y int
value (int)

Returns

int — a value of this type

constant_time_select

XuAPI
pub fn constant_time_select(v int, x int, y int) int

Purpose

Select between x and y in constant time.

Parameters

v int
value (int)
x int
value (int)
y int
value (int)

Returns

int — a value of this type

xor_bytes

XuAPI
pub fn xor_bytes(x &string, y &string) string

Purpose

Xor bytes. Throws on failure; handle the error or propagate it to the caller.

Parameters

x &string
value (read-only borrow; caller keeps the original; type &string)
y &string
value (read-only borrow; caller keeps the original; type &string)

Returns

string — result string