File: conventions.txt

package info (click to toggle)
hare 0.26.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,352 kB
  • sloc: asm: 1,374; makefile: 123; sh: 117; lisp: 101
file content (16 lines) | stat: -rw-r--r-- 824 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
This is a WIP document offering some advice on how to implement cryptographic
algorithms securely for Hare.

All cryptographic algorithms must be constant time, such that an attacker cannot
learn any secret information by analysis of the time required to complete a
cryptographic operation. Not all of the math performed by cryptographic
algorithms in Hare needs to be constant-time: just math whose inputs include
secret information.

It is important to know that secret data has been securely erased from memory
when it is no longer required. A few items to note about Hare:

- Return-by-value will leave garbage on the stack which is copied into the
  caller's stack frame and abandoned. You cannot return-by-value any objects
  which contain secret information.
- To securely erase an array's contents, use bytes::zero.