VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.0/include/crypto/siphash.h@ 100908

最後變更 在這個檔案從100908是 99366,由 vboxsync 提交於 22 月 前

openssl-3.1.0: Applied and adjusted our OpenSSL changes to 3.0.7. bugref:10418

檔案大小: 1.6 KB
 
1/*
2 * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#ifndef OSSL_CRYPTO_SIPHASH_H
11# define OSSL_CRYPTO_SIPHASH_H
12# ifndef RT_WITHOUT_PRAGMA_ONCE /* VBOX */
13# pragma once
14# endif /* VBOX */
15
16# include <stddef.h>
17
18# define SIPHASH_BLOCK_SIZE 8
19# define SIPHASH_KEY_SIZE 16
20# define SIPHASH_MIN_DIGEST_SIZE 8
21# define SIPHASH_MAX_DIGEST_SIZE 16
22
23typedef struct siphash_st SIPHASH;
24
25size_t SipHash_ctx_size(void);
26size_t SipHash_hash_size(SIPHASH *ctx);
27int SipHash_set_hash_size(SIPHASH *ctx, size_t hash_size);
28int SipHash_Init(SIPHASH *ctx, const unsigned char *k,
29 int crounds, int drounds);
30void SipHash_Update(SIPHASH *ctx, const unsigned char *in, size_t inlen);
31int SipHash_Final(SIPHASH *ctx, unsigned char *out, size_t outlen);
32
33/* Based on https://131002.net/siphash C reference implementation */
34
35struct siphash_st {
36 uint64_t total_inlen;
37 uint64_t v0;
38 uint64_t v1;
39 uint64_t v2;
40 uint64_t v3;
41 unsigned int len;
42 unsigned int hash_size;
43 unsigned int crounds;
44 unsigned int drounds;
45 unsigned char leavings[SIPHASH_BLOCK_SIZE];
46};
47
48/* default: SipHash-2-4 */
49# define SIPHASH_C_ROUNDS 2
50# define SIPHASH_D_ROUNDS 4
51
52#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette