ARMmbed / ARMmbed/mbed-crypto

Missing test coverage for ciphers not requiring IVs

Open
#60 2 comments 0 reactions 0 assignees View on GitHub
enhancement Jira status: REOPENED mirrored type: enhancement
Dominant language
C
Stars
108
Forks
95
PR merge metrics
No merged PRs in 30d

Description

### Description

Because we don't have any cipher modes that don't require an IV (e.g. RC4), we can't test [this area of code](https://github.com/ARMmbed/mbed-crypto/blob/development/library/psa_crypto.c#L3038) properly.

```C
psa_status_t psa_cipher_set_iv( psa_cipher_operation_t *operation,
const unsigned char *iv,
size_t iv_length )
{
psa_status_t status;
int ret;
if( operation->iv_set || ! operation->iv_required )
{
status = PSA_ERROR_BAD_STATE;
goto exit;
}
/* ... */
```

### Issue request type

[ ] Question
[X] Enhancement
[ ] Bug

Contributor guide

Open the contributing guide

Research direction

Start by reading library/psa_crypto.c around line 3038 and trace how cipher modes declare whether an IV is required. Identify the existing cipher test entry points, then add coverage for a cipher mode that does not require an IV and verify the psa_cipher_set_iv() behavior is exercised.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cryptography
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.