/
githubmirror
/
ipxe
Обзор
Документация
Войти
/
githubmirror
/
ipxe
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v0.9.4
src/crypto/cipher.c
23 строки
551 B
Michael Brown
Add per-file error identifiers
24 июл 2007, 20:11
24 июл 2007, 20:11
9aa61ad
Код
Авторство
О чём код?
#include <stdint.h> #include <errno.h> #include <gpxe/crypto.h> int cipher_encrypt ( struct crypto_algorithm *crypto, void *ctx, const void *src, void *dst, size_t len ) { if ( ( len & ( crypto->blocksize - 1 ) ) ) { return -EINVAL; } crypto->encode ( ctx, src, dst, len ); return 0; } int cipher_decrypt ( struct crypto_algorithm *crypto, void *ctx, const void *src, void *dst, size_t len ) { if ( ( len & ( crypto->blocksize - 1 ) ) ) { return -EINVAL; } crypto->decode ( ctx, src, dst, len ); return 0; }