Exemple #1
0
static int setkey(struct crypto_tfm *tfm, const u8 *key,
		  unsigned int keysize)
{
	struct salsa20_ctx *ctx = crypto_tfm_ctx(tfm);
	salsa20_keysetup(ctx, key, keysize*8, SALSA20_IV_SIZE*8);
	return 0;
}
Exemple #2
0
wasp_salsa20_key wasp_make_salsa20_key( wasp_string seed ){
    int seedlen = wasp_string_length( seed );
    if( seedlen != 32 ) 
        wasp_errf( wasp_es_vm, "si", 
                           "Salsa20 keys must be 32 bytes long", seedlen );
    wasp_salsa20_key key = WASP_OBJALLOC( salsa20_key );

    salsa20_keysetup( & key->context, wasp_sf_string( seed ) );

    return key;
}