};
static bool nametocipher(const char *name, int *algo, int *mode) {
- int i;
+ size_t i;
for(i = 0; i < sizeof ciphertable / sizeof *ciphertable; i++) {
if(ciphertable[i].name && !strcasecmp(name, ciphertable[i].name)) {
}
static bool nidtocipher(int nid, int *algo, int *mode) {
- int i;
+ size_t i;
for(i = 0; i < sizeof ciphertable / sizeof *ciphertable; i++) {
if(nid == ciphertable[i].nid) {
}
static bool ciphertonid(int algo, int mode, int *nid) {
- int i;
+ size_t i;
for(i = 0; i < sizeof ciphertable / sizeof *ciphertable; i++) {
if(algo == ciphertable[i].algo && mode == ciphertable[i].mode) {
return true;
}
-bool cipher_set_key(cipher_t *cipher, void *key, size_t len, bool encrypt) {
+bool cipher_set_key_from_rsa(cipher_t *cipher, void *key, size_t len, bool encrypt) {
memcpy(cipher->key, key + len - cipher->keylen, cipher->keylen + cipher->blklen);
memcpy(cipher->key + cipher->keylen, key + len - cipher->keylen - cipher->blklen, cipher->blklen);