Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #7419

Closed (moved)
Open
Opened Nov 08, 2012 by Nick Mathewson@nickm🥄

Choose a faster memwipe implementation

Our current memwipe implementation (see #7352 (moved)) was chosen for being very-likely-to-be-safe, not for its speed. We could get much faster, probably: All we really need is a memwipe, plus some way to tell the compiler that the memwipe shouldn't be eliminated.

One GCC-only option is

void memwipe(void *p, uint8_t b, size_t sz) __attribtue__((noinline));
void memwipe(void *p, uint8_t b, size_t sz)
{
   memset(p, b, sz);
}

Another, crazier GCC-only option is

inline void 
memwipe(void *p, uint8_t b, size_t sz)
{
   memset(p, b, sz);
   asm("" ::: "memory");
}

And on windows, one could probably say

void
memwipe(void *p, uint8_t b, size_t sz)
{
   SecureZeroMemory(p, sz);
}

if b == 0.

Probably, we shouldn't bother to do any of these unless it turns out that OPENSSL_cleanse() is showing up in our profiles.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Tor: 0.2.8.x-final
Milestone
Tor: 0.2.8.x-final
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#7419