2015-05-26 06:38:12 +02:00
|
|
|
#include "shadouble.h"
|
2015-06-24 08:45:34 +02:00
|
|
|
#include "valgrind.h"
|
2015-05-26 06:38:12 +02:00
|
|
|
|
|
|
|
void sha256_double(struct sha256_double *shadouble, const void *p, size_t len)
|
|
|
|
{
|
2015-06-24 08:45:34 +02:00
|
|
|
sha256(&shadouble->sha, check_mem(p, len), len);
|
2015-05-27 06:25:20 +02:00
|
|
|
sha256(&shadouble->sha, &shadouble->sha, sizeof(shadouble->sha));
|
2015-05-26 06:38:12 +02:00
|
|
|
}
|
|
|
|
|
2015-05-27 06:25:20 +02:00
|
|
|
void sha256_double_done(struct sha256_ctx *shactx, struct sha256_double *res)
|
2015-05-26 06:38:12 +02:00
|
|
|
{
|
2015-05-27 06:25:20 +02:00
|
|
|
sha256_done(shactx, &res->sha);
|
|
|
|
sha256(&res->sha, &res->sha, sizeof(res->sha));
|
2015-05-26 06:38:12 +02:00
|
|
|
}
|