XU XUv0.13.1
EN

#crypto/hkdf

导入方式: #crypto/hkdf

公开 API: 3 函数, 0 方法, 0 类型, 0 常量, 0 方法集

标准库包 `#crypto/hkdf`。

extract

XuAPI
pub fn extract(secret &string, salt &string) string

用途

执行 extract 处理。

参数

secret &string
secret(只读借用,调用方仍持有原值;类型 &string)
salt &string
salt(只读借用,调用方仍持有原值;类型 &string)

返回值

string — 结果字符串

expand

XuAPI
pub fn expand(prk &string, info &string, length int) string

用途

执行 expand 处理。失败时抛出错误,调用方需处理或继续传播。

参数

prk &string
prk(只读借用,调用方仍持有原值;类型 &string)
info &string
info(只读借用,调用方仍持有原值;类型 &string)
length int
length(int)

返回值

string — 结果字符串

key

XuAPI
pub fn key(secret &string, salt &string, info &string, length int) string

用途

键。失败时抛出错误,调用方需处理或继续传播。

参数

secret &string
secret(只读借用,调用方仍持有原值;类型 &string)
salt &string
salt(只读借用,调用方仍持有原值;类型 &string)
info &string
info(只读借用,调用方仍持有原值;类型 &string)
length int
length(int)

返回值

string — 结果字符串