File: go-sha1.h

package info (click to toggle)
gcc-riscv64-unknown-elf 8.3.0.2019.08%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 680,956 kB
  • sloc: ansic: 3,237,715; cpp: 896,882; ada: 772,854; f90: 144,254; asm: 68,788; makefile: 67,456; sh: 29,743; exp: 28,045; objc: 15,273; fortran: 11,885; python: 7,369; pascal: 5,375; awk: 3,725; perl: 2,872; yacc: 316; xml: 311; ml: 285; lex: 198; haskell: 122
file content (33 lines) | stat: -rw-r--r-- 1,029 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// go-sha1.h -- GCC specific sha1 checksum utilities.   -*- C++ -*-

// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

#ifndef GO_SHA1_H
#define GO_SHA1_H

#include "go-system.h"

//
// Interface class for computation of SHA1 checksums. Front end requests
// one of these objects from the back end to use for computing
// checksums (each back end tends to have a different SHA1 implementation).
// Back ends are expected to create a new class that derives from this
// one containing an implementation.
//

class Go_sha1_helper
{
 public:
  virtual ~Go_sha1_helper() { }
  virtual void process_bytes(const void* buffer, size_t len) = 0;
  virtual std::string finish() = 0;
  static const int checksum_len = 20;
};

// Call to create and return a new sha1 helper (this routine defined
// by the backend). Caller is responsible for deletion.
extern Go_sha1_helper* go_create_sha1_helper();

#endif // !defined(GO_SHA1_H)