meow_verify 37e50606; nyai f2938d28; svc_power e0494eb7; launcher 24c9ee5d(含热重载) 宿主验证12项全过(正例/篡负载/篡包名/无签系统包拒/第三方直装/降级拒/导出round-trip byte-identical/verify缺失宁缺勿装/footer容忍/E2E PERM/鉴权分类) 出入: TweetNaCl替orlp/ed25519(任务允许同等实现); 读级暂仍uid==0(用户随后定案放宽到任意调用者,待改); 系统身份allowlist为启发式
22 lines
733 B
C
22 lines
733 B
C
/* sha256.h — minimal public-domain SHA-256 context/API for MeowOS .mpk payload hashing.
|
|
* Used by meow_verify (device) and meow_sign (host) to compute .mpk 的 payload_sha256
|
|
* (tar.gz 前缀哈希)。流式 API,避免整包载入内存。 */
|
|
#ifndef MEOW_SHA256_H
|
|
#define MEOW_SHA256_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
typedef struct {
|
|
uint32_t state[8];
|
|
uint64_t count; /* 已输入总字节数 */
|
|
uint8_t buf[64]; /* 未满一块的缓冲 */
|
|
size_t buflen;
|
|
} meow_sha256_ctx;
|
|
|
|
void meow_sha256_init(meow_sha256_ctx *c);
|
|
void meow_sha256_update(meow_sha256_ctx *c, const uint8_t *data, size_t len);
|
|
void meow_sha256_final(meow_sha256_ctx *c, uint8_t out[32]);
|
|
|
|
#endif /* MEOW_SHA256_H */
|