summaryrefslogtreecommitdiff
path: root/src/sbearssl/sbearssl_ec_pkey_from.c
blob: 55c565122c9e3cbbe97aa969d2cbb8350c0825b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* ISC license. */

#include <bearssl.h>
#include <skalibs/stralloc.h>
#include <s6-networking/sbearssl.h>

int sbearssl_ec_pkey_from (sbearssl_ec_pkey *l, br_ec_public_key const *k, stralloc *sa)
{
  if (!stralloc_catb(sa, k->q, k->qlen)) return 0 ;
  l->curve = k->curve ;
  l->q = sa->len - k->qlen ;
  l->qlen = k->qlen ;
  return 1 ;
}