/** * SM4 加密解密工具 * 基于 sm-crypto 库实现 */ /** * SM4 加密选项 */ export interface Sm4Options { /** 待加密/解密内容 */ content: string; /** 密钥 (16字节) */ key: string; /** 加密模式: ecb/cbc,默认 ecb */ mode?: 'ecb' | 'cbc'; /** 密钥格式: hex/base64,默认 hex */ keyFormat?: 'hex' | 'base64'; /** IV偏移量(cbc模式必填,16字节) */ iv?: string; /** IV格式: utf8/hex,默认 hex */ ivFormat?: 'utf8' | 'hex'; /** 密文格式: utf8/hex,默认 hex */ cipherMode?: 'utf8' | 'hex'; /** 填充方式: pkcs#7/none,默认 pkcs#7 */ padding?: 'pkcs#7' | 'none'; } /** * SM4 加密函数 * @param options - 加密选项 * @returns 加密后的密文 */ export declare function sm4Encode(options: Sm4Options): string; /** * SM4 解密函数 * @param options - 解密选项 * @returns 解密后的原文 */ export declare function sm4Decode(options: Sm4Options): string; //# sourceMappingURL=index.d.ts.map