}
if (key_bits != 128 && key_bits != 192 && key_bits != 256)
- return -1;
+ return AVERROR(EINVAL);
a->rounds = rounds;
uint64_t Kl[2], Kr[2], Ka[2], Kb[2];
uint64_t D1, D2;
if (key_bits != 128 && key_bits != 192 && key_bits != 256)
- return -1;
+ return AVERROR(EINVAL);
memset(Kb, 0, sizeof(Kb));
memset(Kr, 0, sizeof(Kr));
cs->key_bits = key_bits;
int i;
uint32_t p[4], q[4];
if (key_bits % 8 || key_bits < 40 || key_bits > 128)
- return -1;
+ return AVERROR(EINVAL);
memset(newKey, 0, sizeof(newKey));
memcpy(newKey, key, key_bits >> 3);
int av_des_init(AVDES *d, const uint8_t *key, int key_bits, av_unused int decrypt) {
if (key_bits != 64 && key_bits != 192)
- return -1;
+ return AVERROR(EINVAL);
d->triple_des = key_bits > 64;
gen_roundkeys(d->round_keys[0], AV_RB64(key));
if (d->triple_des) {
uint8_t *state = r->state;
int keylen = key_bits >> 3;
if (key_bits & 7)
- return -1;
+ return AVERROR(EINVAL);
for (i = 0; i < 256; i++)
state[i] = i;
y = 0;
ctx->transform = ripemd320_transform;
break;
default:
- return -1;
+ return AVERROR(EINVAL);
}
ctx->count = 0;
return 0;
ctx->transform = sha256_transform;
break;
default:
- return -1;
+ return AVERROR(EINVAL);
}
ctx->count = 0;
return 0;
ctx->state[7] = UINT64_C(0x5BE0CD19137E2179);
break;
default:
- return -1;
+ return AVERROR(EINVAL);
}
ctx->count = 0;
return 0;
uint32_t Key[8], Me[4], Mo[4], A, B;
const uint32_t rho = 0x01010101;
if (key_bits < 0)
- return -1;
+ return AVERROR(EINVAL);
if (key_bits <= 128) {
cs->ksize = 2;
} else if (key_bits <= 192) {