|
Revision 136
(checked in by ben, 8 years ago)
|
Partial signature code, prior to refactor for verification.
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
#include <sys/types.h> |
|---|
| 5 |
#include <openssl/bn.h> |
|---|
| 6 |
#include "packet.h" |
|---|
| 7 |
|
|---|
| 8 |
#ifndef OPS_MEMORY_H |
|---|
| 9 |
#define OPS_MEMORY_H |
|---|
| 10 |
|
|---|
| 11 |
typedef struct |
|---|
| 12 |
{ |
|---|
| 13 |
unsigned char *buf; |
|---|
| 14 |
size_t length; |
|---|
| 15 |
size_t allocated; |
|---|
| 16 |
} ops_memory_t; |
|---|
| 17 |
|
|---|
| 18 |
void ops_memory_init(ops_memory_t *mem,size_t initial_size); |
|---|
| 19 |
void ops_memory_pad(ops_memory_t *mem,size_t length); |
|---|
| 20 |
void ops_memory_add(ops_memory_t *mem,const unsigned char *src,size_t length); |
|---|
| 21 |
void ops_memory_add_int(ops_memory_t *mem,unsigned n,size_t length); |
|---|
| 22 |
void ops_memory_place_int(ops_memory_t *mem,unsigned offset,unsigned n, |
|---|
| 23 |
size_t length); |
|---|
| 24 |
void ops_memory_add_mpi(ops_memory_t *out,const BIGNUM *bn); |
|---|
| 25 |
void ops_memory_make_packet(ops_memory_t *out,ops_content_tag_t tag); |
|---|
| 26 |
void ops_memory_release(ops_memory_t *mem); |
|---|
| 27 |
|
|---|
| 28 |
ops_writer_ret_t ops_writer_memory(const unsigned char *src,unsigned length, |
|---|
| 29 |
ops_writer_flags_t flags,void *arg_); |
|---|
| 30 |
|
|---|
| 31 |
#endif |
|---|
| 32 |
|
|---|