-/* $OpenBSD: evp_cipher.c,v 1.9 2024/01/02 20:00:45 tb Exp $ */
+/* $OpenBSD: evp_cipher.c,v 1.10 2024/01/02 20:48:40 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
return 1;
}
-int
-EVP_CIPHER_block_size(const EVP_CIPHER *cipher)
-{
- return cipher->block_size;
-}
-
int
EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx)
{
return ctx->encrypt;
}
-unsigned long
-EVP_CIPHER_flags(const EVP_CIPHER *cipher)
-{
- return cipher->flags;
-}
-
unsigned long
EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx)
{
return old_cipher_data;
}
-int
-EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
-{
- return cipher->iv_len;
-}
-
int
EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx)
{
return ctx->buf;
}
-int
-EVP_CIPHER_key_length(const EVP_CIPHER *cipher)
-{
- return cipher->key_len;
-}
-
int
EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx)
{
return ctx->key_len;
}
-int
-EVP_CIPHER_nid(const EVP_CIPHER *cipher)
-{
- return cipher->nid;
-}
-
int
EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx)
{
}
}
+/*
+ * Accessors. First the trivial getters, then the setters for the method API.
+ */
+
+int
+EVP_CIPHER_nid(const EVP_CIPHER *cipher)
+{
+ return cipher->nid;
+}
+
+int
+EVP_CIPHER_block_size(const EVP_CIPHER *cipher)
+{
+ return cipher->block_size;
+}
+
+int
+EVP_CIPHER_key_length(const EVP_CIPHER *cipher)
+{
+ return cipher->key_len;
+}
+
+int
+EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
+{
+ return cipher->iv_len;
+}
+
+unsigned long
+EVP_CIPHER_flags(const EVP_CIPHER *cipher)
+{
+ return cipher->flags;
+}
+
EVP_CIPHER *
EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len)
{