Files
Viper_VRTE/openssl/sha.vp
T

29 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import t, c
from openssl.types import *
# ============================================================
# openssl/sha.vp — SHA-1 / SHA-2 一次性摘要
# 对应头文件: sha.h
#
# OpenSSL 3.x 推荐走 EVP(见 evp.vp: EVP_DigestInit_ex/Update/Final_ex),
# 这里保留传统一次性接口,方便快速算摘要。
# ============================================================
ShaDigestLength: t.CDefine = 20
Sha224DigestLength: t.CDefine = 28
Sha256DigestLength: t.CDefine = 32
Sha384DigestLength: t.CDefine = 48
Sha512DigestLength: t.CDefine = 64
# unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md)
extern def SHA1(d: bytes, n: t.CSizeT, md: bytes) -> bytes
# unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md)
extern def SHA224(d: bytes, n: t.CSizeT, md: bytes) -> bytes
# unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md)
extern def SHA256(d: bytes, n: t.CSizeT, md: bytes) -> bytes
# unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md)
extern def SHA384(d: bytes, n: t.CSizeT, md: bytes) -> bytes
# unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md)
extern def SHA512(d: bytes, n: t.CSizeT, md: bytes) -> bytes
# SHA-3 只经 EVP 提供(EVP_sha3_256() 等,见 evp.vp)