hardware

PKCS#11. Possibility of performing Ecryption/Decryption in hardware

早过忘川 提交于 2020-01-13 11:30:07
问题 Cheers. This is a copy of my question on crypto stack exchange. I'm dealing with HSM via PKCS#11 C/Python interface. I'm wondering is it possible to do some C_Encrypt / C_Decrypt in hardware. By saying "in hardware" I mean encryption/decryption without exposing the result to the caller space. This is mostly aboud decryption as I want to call C_Decrypt and leave the result inside the HSM as arbitrary data to do some other transformations on that data later, saying re-encrypting it on some

What algorithms do FPUs use to compute transcendental functions?

帅比萌擦擦* 提交于 2020-01-13 09:01:07
问题 What methods would a modern FPU use to compute transcendental functions? For example, Intel CPUs provide instructions such as FSIN , FCOS , FYL2X , etc. I am curious as to what algorithms would be used to actually implement these in hardware. My naïve guess would be Taylor series perhaps combined with some lookup tables, but that's nothing more than a wild guess. Please enlighten me. P.S. This question is more general than just Intel hardware. 回答1: One place to start could be "New Algorithms

Branch on ?: operator?

有些话、适合烂在心里 提交于 2020-01-11 08:28:11
问题 For a typical modern compiler on modern hardware, will the ? : operator result in a branch that affects the instruction pipeline? In other words which is faster, calling both cases to avoid a possible branch: bool testVar = someValue(); // Used later. purge(white); purge(black); or picking the one actually needed to be purged and only doing it with an operator ?: : bool testVar = someValue(); purge(testVar ? white : black); I realize you have no idea how long purge() will take, but I'm just

Multicores and mulithreads [closed]

梦想的初衷 提交于 2020-01-11 07:55:10
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . If a software devoloped with multi threading , Is it true that multicore processor executes that software efficiently by using software threads of operating system i.e when i create multiple threads in java those

Execute automatic change connected displays in Windows 8

本秂侑毒 提交于 2020-01-10 19:33:10
问题 Short version How do I automate changing multiple display settings? NVIDIA, 3x monitors (2x DVI and 1x HDMI), GPU only supports 2 active monitors. Long version So I have a NVIDIA GeForce GTX 560 Ti which can run two displays simultaneously. It has two DVI connections and one HDMI . I often swap from using my two desktop monitors and connect only one of the desktop monitors plus my TV using HDMI . I would like to automate the change back and forward using a batch script or other program

read CPU cache contents

夙愿已清 提交于 2020-01-09 19:07:21
问题 Is there any way to read the CPU cache contents? Architecture is for ARM. I m invalidating a range of addresses and then want to make sure whether it is invalidated or not. Although I can do read and write of the range of addresses with and without invalidating and checking the invalidation, I want to know whether it is possible to read the cache contents Thanks!! 回答1: ARM9 provides cache manipulation and test registers that allow you to examine the state of the cache. Here's a reasonable

What is the proper way to fill a HARDWAREINPUT struct for use with SendInput?

僤鯓⒐⒋嵵緔 提交于 2020-01-07 08:34:09
问题 I'm trying to send a WM_KEYDOWN/WM_KEYUP pair to an application which normally does NOT respond to the use of the KEYBDINPUT struct. I will need to send the escape key, as well as alphanumeric characters. As the MSDN only gives vague information on using the hardware struct, I could only assume that the uMsg field is meant to hold WM_KEYDOWN/WM_KEYUP messages, and the the next two fields are for the LOWORD and HIWORD of lParam (composed of several bits which define the scan code, whether or

How to get the default audio device?

扶醉桌前 提交于 2020-01-06 08:14:13
问题 I'm using a 3-rd party DLL which can enumerate the audio devices (providing name and guid-id) and set an audio device to the default one (by the id). How can I get the current audio device (which is used by OS)? I need either name or device id. This question seems to have no useful answers. This one as well. 回答1: You can use DirectShow for this. private IBaseFilter CreateFilter(Guid category, string name) { object source = null; Guid guid = typeof(IBaseFilter).GUID; foreach (DsDevice device

How to get the default audio device?

拥有回忆 提交于 2020-01-06 08:14:11
问题 I'm using a 3-rd party DLL which can enumerate the audio devices (providing name and guid-id) and set an audio device to the default one (by the id). How can I get the current audio device (which is used by OS)? I need either name or device id. This question seems to have no useful answers. This one as well. 回答1: You can use DirectShow for this. private IBaseFilter CreateFilter(Guid category, string name) { object source = null; Guid guid = typeof(IBaseFilter).GUID; foreach (DsDevice device

controlling a hardware connected to a com port [duplicate]

痞子三分冷 提交于 2020-01-06 07:25:26
问题 This question already has an answer here : Closed 9 years ago . Possible Duplicate: i want to make a web site which is able to control a hardware on a clients computer. the the hardware for example be a simple gsm modem this is a general question, for asking of methods and opinions as for the following control this hardware using the computer the hardware is connected to. control this hardware using another computer over a network control this hardware using a web site application or a simple