Changeset View
Changeset View
Standalone View
Standalone View
sys/opencrypto/xform_sha1.c
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
#include <crypto/sha1.h> | #include <crypto/sha1.h> | ||||
#include <opencrypto/xform_auth.h> | #include <opencrypto/xform_auth.h> | ||||
static void SHA1Init_int(void *); | static void SHA1Init_int(void *); | ||||
static int SHA1Update_int(void *, const void *, u_int); | static int SHA1Update_int(void *, const void *, u_int); | ||||
static void SHA1Final_int(uint8_t *, void *); | static void SHA1Final_int(uint8_t *, void *); | ||||
/* Plain hash */ | /* Plain hash */ | ||||
struct auth_hash auth_hash_sha1 = { | const struct auth_hash auth_hash_sha1 = { | ||||
.type = CRYPTO_SHA1, | .type = CRYPTO_SHA1, | ||||
.name = "SHA1", | .name = "SHA1", | ||||
.hashsize = SHA1_HASH_LEN, | .hashsize = SHA1_HASH_LEN, | ||||
.ctxsize = sizeof(SHA1_CTX), | .ctxsize = sizeof(SHA1_CTX), | ||||
.blocksize = SHA1_BLOCK_LEN, | .blocksize = SHA1_BLOCK_LEN, | ||||
.Init = SHA1Init_int, | .Init = SHA1Init_int, | ||||
.Update = SHA1Update_int, | .Update = SHA1Update_int, | ||||
.Final = SHA1Final_int, | .Final = SHA1Final_int, | ||||
}; | }; | ||||
/* Authentication instances */ | /* Authentication instances */ | ||||
struct auth_hash auth_hash_hmac_sha1 = { | const struct auth_hash auth_hash_hmac_sha1 = { | ||||
.type = CRYPTO_SHA1_HMAC, | .type = CRYPTO_SHA1_HMAC, | ||||
.name = "HMAC-SHA1", | .name = "HMAC-SHA1", | ||||
.keysize = SHA1_BLOCK_LEN, | .keysize = SHA1_BLOCK_LEN, | ||||
.hashsize = SHA1_HASH_LEN, | .hashsize = SHA1_HASH_LEN, | ||||
.ctxsize = sizeof(SHA1_CTX), | .ctxsize = sizeof(SHA1_CTX), | ||||
.blocksize = SHA1_BLOCK_LEN, | .blocksize = SHA1_BLOCK_LEN, | ||||
.Init = SHA1Init_int, | .Init = SHA1Init_int, | ||||
.Update = SHA1Update_int, | .Update = SHA1Update_int, | ||||
Show All 24 Lines |