Philip Zimmermann c7e476402a Relicense bnlib under GPLv2/GPLv3 with exception for FreeSWITCH
Thanks to Travis Cross for much of the language here.

Signed-off-by: Philip Zimmermann <prz@mit.edu>
Signed-off-by: Travis Cross <tc@traviscross.com>
2012-03-31 22:56:22 +00:00

56 lines
746 B
C

/*
* Copyright (c) 1995 Colin Plumb. All rights reserved.
* For licensing and other legal details, see the file legal.c.
*
* keys.c - allocate and free PubKey and SecKey structures.
*/
#include "first.h"
#include "bn.h"
#include "keys.h"
#include "usuals.h"
void
pubKeyBegin(struct PubKey *pub)
{
if (pub) {
bnBegin(&pub->n);
bnBegin(&pub->e);
}
}
void
pubKeyEnd(struct PubKey *pub)
{
if (pub) {
bnEnd(&pub->n);
bnEnd(&pub->e);
wipe(pub);
}
}
void
secKeyBegin(struct SecKey *sec)
{
if (sec) {
bnBegin(&sec->d);
bnBegin(&sec->p);
bnBegin(&sec->q);
bnBegin(&sec->u);
}
}
void
secKeyEnd(struct SecKey *sec)
{
if (sec) {
bnEnd(&sec->d);
bnEnd(&sec->p);
bnEnd(&sec->q);
bnEnd(&sec->u);
wipe(sec);
}
}