llvm/llvm/lib/Support/SHA1.cpp

//====- SHA1.cpp - Private copy of the SHA1 implementation ---*- C++ -* ======//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This code is taken from public domain
// (http://oauth.googlecode.com/svn/code/c/liboauth/src/sha1.c and
// http://cvsweb.netbsd.org/bsdweb.cgi/src/common/lib/libc/hash/sha1/sha1.c?rev=1.6)
// and modified by wrapping it in a C++ interface for LLVM,
// and removing unnecessary code.
//
//===----------------------------------------------------------------------===//

#include "llvm/Support/SHA1.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/SwapByteOrder.h"
#include <string.h>

usingnamespacellvm;

static inline uint32_t rol(uint32_t Number, int Bits) {}

static inline uint32_t blk0(uint32_t *Buf, int I) {}

static inline uint32_t blk(uint32_t *Buf, int I) {}

static inline void r0(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D,
                      uint32_t &E, int I, uint32_t *Buf) {}

static inline void r1(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D,
                      uint32_t &E, int I, uint32_t *Buf) {}

static inline void r2(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D,
                      uint32_t &E, int I, uint32_t *Buf) {}

static inline void r3(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D,
                      uint32_t &E, int I, uint32_t *Buf) {}

static inline void r4(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D,
                      uint32_t &E, int I, uint32_t *Buf) {}

/* code */
#define SHA1_K0
#define SHA1_K20
#define SHA1_K40
#define SHA1_K60

#define SEED_0
#define SEED_1
#define SEED_2
#define SEED_3
#define SEED_4

void SHA1::init() {}

void SHA1::hashBlock() {}

void SHA1::addUncounted(uint8_t Data) {}

void SHA1::writebyte(uint8_t Data) {}

void SHA1::update(ArrayRef<uint8_t> Data) {}

void SHA1::update(StringRef Str) {}

void SHA1::pad() {}

void SHA1::final(std::array<uint32_t, HASH_LENGTH / 4> &HashResult) {}

std::array<uint8_t, 20> SHA1::final() {}

std::array<uint8_t, 20> SHA1::result() {}

std::array<uint8_t, 20> SHA1::hash(ArrayRef<uint8_t> Data) {}