Manuel Pégourié-Gonnard
a878d3b6e3
cmac: avoid useless wrapping of function
...
probably a leftover from an earlier stage
2016-10-13 13:51:09 +01:00
Manuel Pégourié-Gonnard
5f8639fea2
cmac: reduce visibility of macros
...
The #undef is usefull for people who want to to amalgamated releases
2016-10-13 13:51:09 +01:00
Manuel Pégourié-Gonnard
59ae4bad18
cmac: some more padding-related tune-ups
...
- use one less temporary buffer
- pedantic: in_len + 15 was a potential overflow
- use a more explicit name instead of 'flag'
- Mn was a bit misleading
2016-10-13 13:51:08 +01:00
Manuel Pégourié-Gonnard
da8724fbc6
cmac: clean up padding function and comments
2016-10-13 13:51:08 +01:00
Manuel Pégourié-Gonnard
89b8d83723
cmac: make subkey gen more constant-time
...
The previous version had secret-dependent memory accesses. While it was
probably not an issue in practice cause the two bytes of the array are
probably on the same cache line anyway, as a matter of principle this should
be avoided.
2016-10-13 13:51:08 +01:00
Manuel Pégourié-Gonnard
28ea791521
cmac: zeroize sensitive intermediate values
2016-10-13 13:51:08 +01:00
Manuel Pégourié-Gonnard
756bcf7631
cmac: factor multiply by u to its own function
...
We're doing exactly the same operation for K1 and K2.
2016-10-13 13:51:08 +01:00
Manuel Pégourié-Gonnard
a4dfa0550f
cmac: fix whitespace/codingstyle issues
2016-10-13 13:51:08 +01:00
Manuel Pégourié-Gonnard
9c83eebe67
cmac: improve argument order and naming
...
- always use the pattern "buffer, length"
- avoid using unqualified "length" as a name when there are more than one
2016-10-13 13:51:08 +01:00
Robert Cragie
9bf1e5dd3b
Line endings wrong
2016-10-13 13:51:08 +01:00
Robert Cragie
45feb6ef20
Add support for AES-128-CMAC and AES-CMAC-PRF-128
2016-10-13 13:51:07 +01:00