about summary refs log tree commit diff
path: root/src/librandom/surf_sinit.c
blob: f81a5c8b253566588a150f81722592e281f56271 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* ISC license. */

#include <skalibs/uint32.h>
#include <skalibs/surf.h>

void surf_sinit (SURFSchedule *ctx, char const *s)
{
  SURFSchedule zero = SURFSCHEDULE_ZERO ;
  register unsigned int i = 4 ;
  *ctx = zero ;
  for (; i < 12 ; i++) uint32_unpack(s + (i<<2) - 16, ctx->in + i) ;
  for (i = 0 ; i < 32 ; i++) uint32_unpack(s + 32 + (i<<2), ctx->seed + i) ;
}