00001 #ifndef __SHA_CONTEXT__
00002 #define __SHA_CONTEXT__
00003
00004 #include "cuda_mem_pool.hh"
00005 #include "device_context.hh"
00006
00012 class sha_context {
00013 public:
00020 sha_context(device_context *dev_ctx);
00021
00022 ~sha_context();
00023
00046 void hmac_sha1(const void *memory_start,
00047 const unsigned long in_pos,
00048 const unsigned long keys_pos,
00049 const unsigned long pkt_offset_pos,
00050 const unsigned long lengths_pos,
00051 const unsigned long data_size,
00052 unsigned char *out,
00053 const unsigned long num_flows,
00054 unsigned int stream_id);
00055
00069 bool sync(const unsigned int stream_id,
00070 const bool block = true,
00071 const bool copy_result = true);
00072
00073 private:
00074 struct {
00075 uint8_t *out;
00076 uint8_t *out_d;
00077 unsigned long out_len;
00078 } streams[MAX_STREAM + 1];
00079
00080 device_context *dev_ctx_;
00081
00082 };
00083 #endif