515e1639ef
- adds a library to compute the SHA-256 hash - updates the RSA verifier to take an argument specifying either SHA-1 or SHA-256 - updates DumpPublicKey to with new "key" version numbers for specifying SHA-256 - adds new argument to adb auth code to maintain existing behavior Change-Id: I5b1406cf57c2b8993f6032eda3e29139f7740839
30 lines
715 B
C
30 lines
715 B
C
// Copyright 2005 Google Inc. All Rights Reserved.
|
|
// Author: mschilder@google.com (Marius Schilder)
|
|
|
|
#ifndef SECURITY_UTIL_LITE_SHA1_H__
|
|
#define SECURITY_UTIL_LITE_SHA1_H__
|
|
|
|
#include <stdint.h>
|
|
#include "hash-internal.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif // __cplusplus
|
|
|
|
typedef HASH_CTX SHA_CTX;
|
|
|
|
void SHA_init(SHA_CTX* ctx);
|
|
void SHA_update(SHA_CTX* ctx, const void* data, int len);
|
|
const uint8_t* SHA_final(SHA_CTX* ctx);
|
|
|
|
// Convenience method. Returns digest address.
|
|
// NOTE: *digest needs to hold SHA_DIGEST_SIZE bytes.
|
|
const uint8_t* SHA_hash(const void* data, int len, uint8_t* digest);
|
|
|
|
#define SHA_DIGEST_SIZE 20
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif // __cplusplus
|
|
|
|
#endif // SECURITY_UTIL_LITE_SHA1_H__
|