Fix GeneralizedTime fractional seconds implementation #183

Open
opened 2017-03-31 17:17:13 -05:00 by sjaeckel · 0 comments
sjaeckel commented 2017-03-31 17:17:13 -05:00 (Migrated from github.com)

@karel-m https://github.com/libtom/libtomcrypt/pull/182#issuecomment-290703906

Ad implementation I would simply store nanoseconds (if we can afford one "ulong32") like:

- unsigned fs, /* fractional seconds */
+ ulong32  ns, /* nano second */

but I have not think too much about consequences.

Nano seconds won't fit in a ulong32 but micro seconds would be fine.

When I think about the implementation I'd still prefer my bitmasking proposal https://github.com/libtom/libtomcrypt/pull/182#issuecomment-290692178 ... :-D

But regarding the usage I think it'd make most likely sense to provide the API with microseconds instead of the bitmasking proposal...

@karel-m https://github.com/libtom/libtomcrypt/pull/182#issuecomment-290703906 > Ad implementation I would simply store nanoseconds (if we can afford one "ulong32") like: > ```C > - unsigned fs, /* fractional seconds */ > + ulong32 ns, /* nano second */ > ``` > but I have not think too much about consequences. Nano seconds won't fit in a `ulong32` but micro seconds would be fine. When I think about the implementation I'd still prefer my bitmasking proposal https://github.com/libtom/libtomcrypt/pull/182#issuecomment-290692178 ... :-D But regarding the usage I think it'd make most likely sense to provide the API with microseconds instead of the bitmasking proposal...
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libtom/libtomcrypt#183
No description provided.